... l値をどのようにソートするかを制御する引数 ( nulls_first と nulls_last )をとります。 Be cautious when ordering by fields in related models if you are also using distinct() . See the note in distinct() for an explanation of how related model ordering can ... など)。 このケースを考えます: class Event ( Model ): parent = models . ForeignKey ( "self" , on_delete = models . CASCADE , related_name = "children" , ) date = models . DateField () Event . objects . order_by ( "children__date" ) ここで、それぞれの Even ... and may affect uniqueness of the results. The moral here is that if you are using distinct() be careful about ordering by related models. Similarly, when using distinct() and values() together, be careful when ordering by fields not in the values() cal ... ... l値をどのようにソートするかを制御する引数 ( nulls_first と nulls_last )をとります。 Be cautious when ordering by fields in related models if you are also using distinct() . See the note in distinct() for an explanation of how related model ordering can ... など)。 このケースを考えます: class Event ( Model ): parent = models . ForeignKey ( "self" , on_delete = models . CASCADE , related_name = "children" , ) date = models . DateField () Event . objects . order_by ( "children__date" ) ここで、それぞれの Even ... and may affect uniqueness of the results. The moral here is that if you are using distinct() be careful about ordering by related models. Similarly, when using distinct() and values() together, be careful when ordering by fields not in the values() cal ... ... PostgreSQL, as a INTERVAL DAY(9) TO SECOND(6) on Oracle, and as a bigint of microseconds on other backends. Date and time related arithmetic has also been improved on all backends. There is a corresponding form field . Query Expressions, Conditional Ex ... ttribute show_change_link that supports showing a link to an inline object's change form. Use the new django.contrib.admin.RelatedOnlyFieldListFilter in ModelAdmin.list_filter to limit the list_filter choices to foreign objects which are attached to tho ... ission() , indicates whether the user may access the site. Foreign key dropdowns now have buttons for changing or deleting related objects using a popup. django.contrib.admindocs ¶ reStructuredText is now parsed in model docstrings. django.contrib.auth ... ... PostgreSQL, as a INTERVAL DAY(9) TO SECOND(6) on Oracle, and as a bigint of microseconds on other backends. Date and time related arithmetic has also been improved on all backends. There is a corresponding form field . Query Expressions, Conditional Ex ... ttribute show_change_link that supports showing a link to an inline object's change form. Use the new django.contrib.admin.RelatedOnlyFieldListFilter in ModelAdmin.list_filter to limit the list_filter choices to foreign objects which are attached to tho ... ission() , indicates whether the user may access the site. Foreign key dropdowns now have buttons for changing or deleting related objects using a popup. django.contrib.admindocs ¶ reStructuredText is now parsed in model docstrings. django.contrib.auth ... ... m 1 to 9223372036854775807 . QuerySet.in_bulk() may be called without any arguments to return all objects in the queryset. related_query_name now supports app label and class interpolation using the '%(app_label)s' and '%(class)s' strings. Allowed overr ... iding model fields inherited from abstract base classes. The prefetch_related_objects() function is now a public API. QuerySet.bulk_create() sets the primary key on objects when using PostgreSQL. Adde ... pute the difference in microseconds between the lhs and rhs arguments in the datatype used to store DurationField . select_related() prohibits non-relational fields for nested relations ¶ Django 1.8 では select_related() において非リレーショナルフィール ... ... m 1 to 9223372036854775807 . QuerySet.in_bulk() may be called without any arguments to return all objects in the queryset. related_query_name now supports app label and class interpolation using the '%(app_label)s' and '%(class)s' strings. Allowed overr ... iding model fields inherited from abstract base classes. The prefetch_related_objects() function is now a public API. QuerySet.bulk_create() sets the primary key on objects when using PostgreSQL. Adde ... pute the difference in microseconds between the lhs and rhs arguments in the datatype used to store DurationField . select_related() prohibits non-relational fields for nested relations ¶ Django 1.8 では select_related() において非リレーショナルフィール ... ... management command. This command replaces the older validate management command. New Prefetch object for advanced prefetch_related operations. ¶ The new Prefetch object allows customizing prefetch operations. You can specify the QuerySet used to travers ... ustomize the storage location of prefetch results. This enables things like filtering prefetched relations, calling select_related() from a prefetched relation, or prefetching the same relation multiple times with different querysets. See prefetch_relat ... discovered in abstract classes. It is now possible to avoid creating a backward relation for OneToOneField by setting its related_name to '+' or ending it with '+' . F expressions support the power operator ( ** ). The remove() and clear() methods of t ... ... till need to scan everything to evaluate a non-unique condition. Narrowing your query up-front is more efficient. Retrieve related objects efficiently ¶ Generally, accessing the database multiple times to retrieve different parts of a single "set" of da ... ll usage of your models with a custom manager . Using this fetch mode is easier than declaring fields to fetch with select_related() or prefetch_related() , especially when it's hard to predict which fields will be accessed. QuerySet.select_related() や ... prefetch_related() を使用する ¶ When the FETCH_PEERS fetch mode is not appropriate or efficient enough, use select_related() and prefetch_r ... ... management command. This command replaces the older validate management command. New Prefetch object for advanced prefetch_related operations. ¶ The new Prefetch object allows customizing prefetch operations. You can specify the QuerySet used to travers ... ustomize the storage location of prefetch results. This enables things like filtering prefetched relations, calling select_related() from a prefetched relation, or prefetching the same relation multiple times with different querysets. See prefetch_relat ... discovered in abstract classes. It is now possible to avoid creating a backward relation for OneToOneField by setting its related_name to '+' or ending it with '+' . F expressions support the power operator ( ** ). The remove() and clear() methods of t ... ... till need to scan everything to evaluate a non-unique condition. Narrowing your query up-front is more efficient. Retrieve related objects efficiently ¶ Generally, accessing the database multiple times to retrieve different parts of a single "set" of da ... ll usage of your models with a custom manager . Using this fetch mode is easier than declaring fields to fetch with select_related() or prefetch_related() , especially when it's hard to predict which fields will be accessed. QuerySet.select_related() や ... prefetch_related() を使用する ¶ When the FETCH_PEERS fetch mode is not appropriate or efficient enough, use select_related() and prefetch_r ... 2026年10月08日