... 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 n ... umber 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 ... plate will work with Django 1.2. 目次 Django 1.1.2 リリースノート Backwards-incompatible changes in 1.1.2 Test runner exit status code Cookie encoding One new feature 前のトピックへ Django 1.1.3 リリースノート 次のトピックへ Django 1.1 リリースノート 関 ... ... 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 n ... umber 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 ... plate will work with Django 1.2. 目次 Django 1.1.2 リリースノート Backwards-incompatible changes in 1.1.2 Test runner exit status code Cookie encoding One new feature 前のトピックへ Django 1.1.3 リリースノート 次のトピックへ Django 1.1 リリースノート 関 ... ... スはモデルの一括更新です。 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 メソッド を使用しています。他のタイプのアクションでは ... ... スはモデルの一括更新です。 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 メソッド を使用しています。他のタイプのアクションでは ... ... 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 ¶ ... 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 ... t() . 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 ... ... 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 ¶ ... 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 ... t() . 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 の場合、テストクライアントはブラウザに返されることになる ... ... 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_c ... フレーズです。これは HTTP 標準の デフォルトの reason フレーズを使用します。 reason_phrase が明示的に設定されていない場合、 status_code の値に基づいて決定されます。 HttpResponse. streaming ¶ これは常に False です。 この属性は、ミドルウェアが通常のレスポ ... ¶ レスポンスが閉じられた場合、 True となります。 メソッド ¶ HttpResponse. __init__ ( content = b'' , content_type = None , status = 200 , reason = None , charset = None , headers = None ) [ソース] ¶ 指定されたページ内容、コンテンツタイプ、およびヘッダー ... ... されなかった場合、 content_type から抽出され、もしこれが失敗した場合は、 DEFAULT_CHARSET 設定が使用されます。 HttpResponse. status_code ¶ レスポンスの HTTP ステータスコード 。 reason_phrase が明示的にセットされていない限り、コンストラクタの外で status_c ... フレーズです。これは HTTP 標準の デフォルトの reason フレーズを使用します。 reason_phrase が明示的に設定されていない場合、 status_code の値に基づいて決定されます。 HttpResponse. streaming ¶ これは常に False です。 この属性は、ミドルウェアが通常のレスポ ... ¶ レスポンスが閉じられた場合、 True となります。 メソッド ¶ HttpResponse. __init__ ( content = b'' , content_type = None , status = 200 , reason = None , charset = None , headers = None ) [ソース] ¶ 指定されたページ内容、コンテンツタイプ、およびヘッダー ... 2026年10月08日