... None , ** kwargs ): super () . __init__ ( ** kwargs ) self . min = min self . max = max def check ( self , ** kwargs ): # Call the superclass errors = super () . check ( ** kwargs ) # Do some custom checks and add messages to `errors`: errors . exte ... み込み時には特定のチェックを登録する必要があるため、システムチェックフレームワーク内での統合をテストするのが便利です。これは call_command() 関数を使うことで実現できます。 例えば、このテストは SITE_ID の設定が整数でなければならないことを示しています。こ ... れは組み込みの サイト フレームワークからのチェック のものです: from django.core.management import call_command from django.core.management.base import SystemCheckError from django.test import SimpleTestCase , modify_settings ... ... ers . using ( priority = 10 ) . priority 10 Enqueueing Tasks ¶ To add the Task to the queue store, so it will be executed, call the enqueue() method on it. If the Task takes arguments, these can be passed as-is. For example: result = email_users . en ... serialized to JSON, they must be JSON-serializable: >>> process_data . enqueue ( datetime . now ()) Traceback (most recent call last): ... TypeError : Object of type datetime is not JSON serializable Arguments must also be able to round-trip through ... ctionary . enqueue (( 1 , 2 , 3 )) >>> result . status FAILED >>> result . errors [ 0 ] . traceback Traceback (most recent call last): ... TypeError : unhashable type: 'list' The double_dictionary Task fails because after the JSON round-trip the tupl ... ... ers . using ( priority = 10 ) . priority 10 Enqueueing Tasks ¶ To add the Task to the queue store, so it will be executed, call the enqueue() method on it. If the Task takes arguments, these can be passed as-is. For example: result = email_users . en ... serialized to JSON, they must be JSON-serializable: >>> process_data . enqueue ( datetime . now ()) Traceback (most recent call last): ... TypeError : Object of type datetime is not JSON serializable Arguments must also be able to round-trip through ... ctionary . enqueue (( 1 , 2 , 3 )) >>> result . status FAILED >>> result . errors [ 0 ] . traceback Traceback (most recent call last): ... TypeError : unhashable type: 'list' The double_dictionary Task fails because after the JSON round-trip the tupl ... ... None , ** kwargs ): super () . __init__ ( ** kwargs ) self . min = min self . max = max def check ( self , ** kwargs ): # Call the superclass errors = super () . check ( ** kwargs ) # Do some custom checks and add messages to `errors`: errors . exte ... み込み時には特定のチェックを登録する必要があるため、システムチェックフレームワーク内での統合をテストするのが便利です。これは call_command() 関数を使うことで実現できます。 例えば、このテストは SITE_ID の設定が整数でなければならないことを示しています。こ ... れは組み込みの サイト フレームワークからのチェック のものです: from django.core.management import call_command from django.core.management.base import SystemCheckError from django.test import SimpleTestCase , modify_settings ... ... >> page2 . has_previous () True >>> page2 . has_other_pages () True >>> page2 . next_page_number () Traceback (most recent call last): ... EmptyPage : That page contains no results >>> page2 . previous_page_number () 1 >>> page2 . start_index () # Th ... e 3 >>> page2 . end_index () # The 1-based index of the last item on this page 4 >>> p . page ( 0 ) Traceback (most recent call last): ... EmptyPage : That page number is less than 1 >>> p . page ( 3 ) Traceback (most recent call last): ... EmptyPage ... mport count next previous last ListView Contact contact pages range index span href QuerySet objects Traceback most recent call EmptyPage クイック検索 Last update: 2026年10月09日 « previous | up | next » ... ... ¶ django-admin shell ¶ Python のインタラクティブ・インタープリタを開始します。 All models from installed apps are automatically imported into the shell environment. Models from apps listed earlier in INSTALLED_APPS take precedence. The following com ... , models from django.conf import settings from django.utils import timezone For a --verbosity of 2 or higher, the automatically imported objects will be listed. To disable automatic importing entirely, use the --no-imports flag. See the guide on cus ... uffer オプション と同じように、テストに合格した出力 ( stdout と stderr ) を破棄します。 --no-faulthandler ¶ Django automatically calls faulthandler.enable() when starting the tests, which allows it to print a traceback if the interpreter crashes. Pas ... ... e PostGIS 2 CREATE EXTENSION postgis and the SpatiaLite SELECT InitSpatialMetaData initialization commands are now automatically run by migrate . The GDAL interface now supports retrieving properties of raster (image) data file . Compatibility shims ... compatibility but should not be used any longer. django.contrib.sessions ¶ Session cookie is now deleted after flush() is called. django.contrib.sitemaps ¶ The new Sitemap.i18n attribute allows you to generate a sitemap based on the LANGUAGES settin ... nger creates explicit indexes for foreign keys when using the InnoDB storage engine, as MySQL already creates them automatically. The Oracle backend no longer defines the connection_persists_old_columns feature as True . Instead, Oracle will now incl ... ... ¶ django-admin shell ¶ Python のインタラクティブ・インタープリタを開始します。 All models from installed apps are automatically imported into the shell environment. Models from apps listed earlier in INSTALLED_APPS take precedence. The following com ... , models from django.conf import settings from django.utils import timezone For a --verbosity of 2 or higher, the automatically imported objects will be listed. To disable automatic importing entirely, use the --no-imports flag. See the guide on cus ... uffer オプション と同じように、テストに合格した出力 ( stdout と stderr ) を破棄します。 --no-faulthandler ¶ Django automatically calls faulthandler.enable() when starting the tests, which allows it to print a traceback if the interpreter crashes. Pas ... ... e PostGIS 2 CREATE EXTENSION postgis and the SpatiaLite SELECT InitSpatialMetaData initialization commands are now automatically run by migrate . The GDAL interface now supports retrieving properties of raster (image) data file . Compatibility shims ... compatibility but should not be used any longer. django.contrib.sessions ¶ Session cookie is now deleted after flush() is called. django.contrib.sitemaps ¶ The new Sitemap.i18n attribute allows you to generate a sitemap based on the LANGUAGES settin ... nger creates explicit indexes for foreign keys when using the InnoDB storage engine, as MySQL already creates them automatically. The Oracle backend no longer defines the connection_persists_old_columns feature as True . Instead, Oracle will now incl ... ... l.save() now accepts an update_fields argument, letting you specify which fields are written back to the database when you call save() . This can help in high-concurrency operations, and can improve performance. Better support for streaming responses ... upport, and Django 1.5 supports that alpha release. Python 3 support ¶ Django 1.5 introduces support for Python 3 - specifically, Python 3.2 and above. This comes in the form of a single codebase; you don't need to install a different version of Djan ... hen trying to avoid overwriting concurrent changes. Deferred instances (those loaded by .only() or .defer() ) will automatically save just the loaded fields. If any field is set manually after load, that field will also get updated on save. See the M ... 2026年10月08日