per page, with , order by , clip by
Results of 1 - 2 of about 2 for closepoll (0.004 sec.)
カスタム django-admin コマンドの作り方 11228
カスタム django-admin コマンドの作り方 manage.py を用いることで独自のアクションを登録する事ができます。例として、あなたが配布している Django アプリケーションに manage.py アクションを追加したくなったとします。このドキュメントでは、 このチュー ... トリアル で作成した polls アプリケーションに独自の closepoll コマンドを追加します。 独自のコマンドを追加するためには、 management/commands ディレクトリをアプリケーションに追加してくだ ... ge.py コマンドに登録します。例えば: polls/ __init__.py models.py management/ __init__.py commands/ __init__.py _private.py closepoll.py tests.py views.py この例では、 closepoll コマンドは polls アプリケーションを INSTALLED_APPS に含むプロジェクト全てで利用 ... できるようになります。 _private.py モジュールは管理コマンドとして利用できません。 closepoll.py モジュールには一つだけ満たすべき要件があります。それは、 BaseCommand クラスもしくはその サブクラス の一つを継承した Com ...
https://man.mtool.work/django/6.1/howto/custom-management-commands.html
テストツール 7485
テストツール Django は、テストを書くのに便利なツールをいくつか提供しています。 There are community-maintained solutions! Django has a vibrant ecosystem. There are testing and fixtures solutions highlighted on the Community Ecosystem page. T ... トできます。 from io import StringIO from django.core.management import call_command from django.test import TestCase class ClosepollTest ( TestCase ): def test_command_output ( self ): out = StringIO () call_command ( "closepoll" , poll_ids = [ 1 ], stdou ...
https://man.mtool.work/django/6.1/topics/testing/tools.html
PREV 1 NEXT