... しているように、この属性の内容のpickle化・pickle化の解除は安全に行うことができます(完全にサポートもされています)。 QuerySet.values_list() における制限 pickle化された query 属性を使って QuerySet.values_list() を再生成すると、返り値は QuerySet.values() に ... 置き換えられます: >>> import pickle >>> qs = Blog . objects . values_list ( "id" , "name" ) >>> qs <QuerySet [(1, 'Beatles Blog')]> >>> reloaded_qs = Blog . objects . all () >>> reloaded_qs . ... ed to execute more complex queries (for example, queries with OR statements), you can use Q() オブジェクト ( *args ). NULL values and three-valued logic When passing a QuerySet to the in lookup, ensure the subquery does not return NULL values. See this ... ... s() function now uses Python's email.message.Message for parsing. As a result, parsing of some malformed or unusual header values may differ, for example, RFC 2231 values with a missing encoding are now decoded. This issue has severity "moderate" accor ... ding to the Django security policy . CVE-2026-87890: Potential request forgery via spatial lookup byte values Spatial lookups accepted raster values provided as bytes without requiring them to be explicitly wrapped in GDALRaster . A ... lthough these values were opened through GDAL's in-memory virtual filesystem, they could contain a VRT document referencing an external raster ... ... 次のようなクエリを使います: >>> Book . objects . annotate ( num_authors = Count ( "authors" )) . order_by ( "num_authors" ) values() 通常、アノテーションはオブジェクトごとに生成されます。アノテーションを付けた QuerySet は、元の QuerySet の各オブジェクト ... に対して1つの結果を返します。しかし、 values() 句を使って結果セットで返されるカラムを制限している場合は、アノテーションを付けるしくみが少し異なります。元の QuerySet の ... 各結果に対してアノテーションを付ける代わりに、元の結果は values() 句で指定されたフィールドの一意な組み合わせに従ってグループ化されます。アノテーションはグループのすべてのメンバに対して計 ... ... s() function now uses Python's email.message.Message for parsing. As a result, parsing of some malformed or unusual header values may differ, for example, RFC 2231 values with a missing encoding are now decoded. This issue has severity "moderate" accor ... ding to the Django security policy . CVE-2026-87890: Potential request forgery via spatial lookup byte values Spatial lookups accepted raster values provided as bytes without requiring them to be explicitly wrapped in GDALRaster . A ... lthough these values were opened through GDAL's in-memory virtual filesystem, they could contain a VRT document referencing an external raster ... ... s() function now uses Python's email.message.Message for parsing. As a result, parsing of some malformed or unusual header values may differ, for example, RFC 2231 values with a missing encoding are now decoded. This issue has severity "moderate" accor ... ding to the Django security policy . CVE-2026-87890: Potential request forgery via spatial lookup byte values Spatial lookups accepted raster values provided as bytes without requiring them to be explicitly wrapped in GDALRaster . A ... lthough these values were opened through GDAL's in-memory virtual filesystem, they could contain a VRT document referencing an external raster ... ... ion count for the PBKDF2 password hasher is increased from 1,200,000 to 1,500,000. Permission.name and Permission.codename values are now renamed when renaming models via a migration. The new Permission.user_perm_str property returns the string suitabl ... now supports a --using option to specify the MAILERS alias. モデル QuerySet.in_bulk() now supports chaining after QuerySet.values() and QuerySet.values_list() . The new JSONNull expression provides an explicit way to represent the JSON scalar null . It ... can be used when saving a top-level JSONField value, or querying for top-level or nested JSON null values. See None の保存とクエリ for usage examples and some caveats. DecimalField.max_digits and DecimalField.decimal_places are ... ... ed support for QuerySet.values() and values_list() for union() , difference() , and intersection() queries ( #28781 ). Fixed incorrect index name truncat ... ion when using a namespaced db_table ( #28792 ). Made QuerySet.iterator() use server-side cursors on PostgreSQL after values() and values_list() ( #28817 ). Fixed crash on SQLite and MySQL when ordering by a filtered subquery that uses nulls_first ... ... e original value until it is reloaded . モデルの読み込みをカスタマイズする classmethod Model. from_db ( db , field_names , values , * , fetch_mode = None ) [ソース] from_db() メソッドを使うと、データベースから読み込むときのモデルインスタンス作成をカスタ ... ins the database alias for the database the model is loaded from, field_names contains the names of all loaded fields, and values contains the loaded values for each field in field_names . The field_names are in the same order as the values . If all of ... the model's fields are present, then values are guaranteed to be in the order __init__() expects them. That is, the instance can be created by cls(*values) . If any f ... ... jango 6.1 where ModelAdmin.list_display entries that traverse multiple relations using __ could crash or display incorrect values ( #37270 ). Fixed a bug in Django 6.1 where the fields.E323 system check did not detect mixed on_delete variants for auto- ... 37260 ). Fixed a bug in Django 6.1 where DecimalField without max_digits and decimal_places caused a crash when retrieving values on SQLite ( #37275 ). Fixed a regression in Django 6.1 that caused a crash when iterating a QuerySet of a model overriding ... ups to crash when passed an iterator ( #37311 ). Fixed a bug in Django 6.1 where QuerySet.in_bulk() chained after QuerySet.values() or QuerySet.values_list() could drop selected annotations or produce incorrect mapping keys ( #37312 ). ... ... ete() from crashing on MySQL when querying across relations ( #25882 ). Fixed evaluation of zero-length slices of QuerySet.values() ( #25894 ). Fixed a state bug when using an AlterModelManagers operation ( #25852 ). Fixed TypedChoiceField change detec ... any fixtures ( #23372 ). Restored contrib.auth hashers compatibility with py-bcrypt ( #26016 ). Fixed a crash in QuerySet.values()/values_list() after an annotate() and order_by() when values()/values_list() includes a field not in the order_by() ( #2 ... 2026年10月08日