... スはモデルの一括更新です。 Article モデルを持つニュースアプリケーションを想像してみてください: from django.db import models STATUS_CHOICES = { "d" : "Draft" , "p" : "Published" , "w" : "Withdrawn" , } class Article ( models . Model ): title = models . C ... harField ( max_length = 100 ) body = models . TextField () status = models . CharField ( max_length = 1 , choices = STATUS_CHOICES ) def __str__ ( self ): return self . title このようなモデ ... トを必要としませんが、クエリセットを使用します: def make_published ( modeladmin , request , queryset ): queryset . update ( status = "p" ) 注釈 最高のパフォーマンスを得るために、クエリセットの update メソッド を使用しています。他のタイプのアクションでは ... ... d features in the 1.1 branch, see the Django 1.1 リリースノート . Backwards-incompatible changes in 1.1.2 Test runner exit status code The exit status code of the test runners ( tests/runtests.py and python manage.py test ) no longer represents the num ... ber of failed tests, since a failure of 256 or more tests resulted in a wrong exit status code. The exit status code for the test runner is now 0 for success (no failing tests) and 1 for any number of test failur ... ... ok at the Queue Store for new Tasks to run. When a new Task is added, a Worker claims the Task, executes it, and saves the status and result back to the Queue Store. These workers run outside the request-response lifecycle. Configuring a Task backend T ... ImmediateBackend configured as the default backend: >>> result = double_dictionary . enqueue (( 1 , 2 , 3 )) >>> result . status FAILED >>> result . errors [ 0 ] . traceback Traceback (most recent call last): ... TypeError : unhashable type: 'list' Th ... ult() . Calling get_result() on these backends will raise NotImplementedError . Updating results A TaskResult contains the status of a Task's execution at the point it was retrieved. If the Task finishes after get_result() is called, it will not update ... ... ent >>> c = Client () >>> response = c . post ( "/login/" , { "username" : "john" , "password" : "smith" }) >>> response . status_code 200 >>> response = c . get ( "/customer/details/" ) >>> response . content b'<!DOCTYPE html...' この例が示唆しているよ ... させるリクエストデータです。 wsgi_request レスポンスを生成したテストハンドラーによって生成された WSGIRequest インスタンス。 status_code レスポンスの HTTP ステータスで、数値です。 定義済みのコードの全リストは、 IANA status code registry を参照してください ... です。Django はこれらの例外を内部でキャッチし、適切な HTTP レスポンスコードに変換します。これらの場合、テストでは response.status_code をチェックできます。 Client.raise_request_exception が False の場合、テストクライアントはブラウザに返されることになる ... ... されなかった場合、 content_type から抽出され、もしこれが失敗した場合は、 DEFAULT_CHARSET 設定が使用されます。 HttpResponse. status_code レスポンスの HTTP ステータスコード 。 reason_phrase が明示的にセットされていない限り、コンストラクタの外で status_cod ... フレーズです。これは HTTP 標準の デフォルトの reason フレーズを使用します。 reason_phrase が明示的に設定されていない場合、 status_code の値に基づいて決定されます。 HttpResponse. streaming これは常に False です。 この属性は、ミドルウェアが通常のレスポン ... sed レスポンスが閉じられた場合、 True となります。 メソッド HttpResponse. __init__ ( content = b'' , content_type = None , status = 200 , reason = None , charset = None , headers = None ) [ソース] 指定されたページ内容、コンテンツタイプ、およびヘッダーを ... ... グされたかどうかを示す真偽値。 メソッド SimpleTemplateResponse. __init__ ( template , context = None , content_type = None , status = None , charset = None , using = None , headers = None ) [ソース] SimpleTemplateResponse オブジェクトを、与えられたテンプ ... ディングを含みます。もし content_type が指定されていれば、その値が使われます。それ以外の場合は 'text/html' が使用されます。 status レスポンスの HTTP ステータスコード charset レスポンスがエンコードされる文字コード。省略された場合は content_type から抽出さ ... t について知っています。 メソッド TemplateResponse. __init__ ( request , template , context = None , content_type = None , status = None , charset = None , using = None , headers = None ) [ソース] TemplateResponse オブジェクトを、与えられたリクエスト、 ... ... RSION tuple below for details on VERSION ( example commit ). If this is a pre-release package also update the "Development Status" trove classifier in pyproject.toml to reflect this. An rc pre-release should not change the trove classifier ( example co ... mmit for alpha release , example commit for beta release ). Otherwise, make sure the classifier is set to Development Status :: 5 - Production/Stable . Building the artifacts Optionally use helper scripts You can streamline some of the steps below ... ple in django/__init__.py . This is a five-element tuple, whose elements are: Major version. Minor version. Micro version. Status -- can be one of "alpha", "beta", "rc" or "final". Series number, for alpha/beta/RC packages which run in sequence (allowi ... ... y as _ class Article ( models . Model ): ... def clean ( self ): # Don't allow draft entries to have a pub_date. if self . status == "draft" and self . pub_date is not None : raise ValidationError ( _ ( "Draft entries may not have a publication date." ... )) # Set the pub_date for published items if it hasn't been set already. if self . status == "published" and self . pub_date is None : self . pub_date = datetime . date . today () Note, however, that like Model.f ... します: class Article ( models . Model ): ... def clean ( self ): # Don't allow draft entries to have a pub_date. if self . status == "draft" and self . pub_date is not None : raise ValidationError ( { "pub_date" : _ ( "Draft entries may not have a publ ... ... . attempt [ソース] The number of the current execution attempts for this Task, starting at 1. Task results class TaskResultStatus [ソース] An Enum representing the status of a TaskResult . READY The Task has just been enqueued, or is ready to be execut ... on the backend being used. Task result ids are always strings less than 64 characters. See Task results for more details. status The status of the result. enqueued_at The time when the Task was enqueued. started_at The time when the Task began executi ... ... 'and', 'or' and 'not' as valid variable names. Previously, these strings could be used as variable names. Now, the keyword status is always enforced, and template code such as {% if not %} or {% if and %} will throw a TemplateSyntaxError . Also, in is ... dict__ to obtain a list of fields, you must now be prepared to handle or filter out the _state attribute. Test runner exit status code The exit status code of the test runners ( tests/runtests.py and python manage.py test ) no longer represents the num ... ber of failed tests, because a failure of 256 or more tests resulted in a wrong exit status code. The exit status code for the test runner is now 0 for success (no failing tests) and 1 for any number of test failur ... 2026年10月08日