... a mix of aggregate and non-aggregate expressions. Take the following example: >>> from django.db.models import F , Count , Greatest >>> Book . objects . values ( greatest_pages = Greatest ( "pages" , 600 )) . annotate ( ... num_authors = Count ( "authors ... " ), ... pages_per_author = F ( "greatest_pages" ) / F ( "num_authors" ), ... ) . aggregate ( Avg ( "pages_per_author" )) This creates groups of books based on the ... SQL column GREATEST(pages, 600) . One unique group consists of books with 600 pages or less, and other unique groups will consist of books wit ... ... a mix of aggregate and non-aggregate expressions. Take the following example: >>> from django.db.models import F , Count , Greatest >>> Book . objects . values ( greatest_pages = Greatest ( "pages" , 600 )) . annotate ( ... num_authors = Count ( "authors ... " ), ... pages_per_author = F ( "greatest_pages" ) / F ( "num_authors" ), ... ) . aggregate ( Avg ( "pages_per_author" )) This creates groups of books based on the ... SQL column GREATEST(pages, 600) . One unique group consists of books with 600 pages or less, and other unique groups will consist of books wit ... ... . objects . order_by ( Collate ( "name" , "et-x-icu" )) <QuerySet [<Author: Ursula>, <Author: Veronika>, <Author: Ülle>]> Greatest ¶ class Greatest ( * expressions , ** extra ) [ソース] ¶ 少なくとも2つのフィールド名または式のリストを受け取り、最大値を返 ... now = True ) blog = models . ForeignKey ( Blog , on_delete = models . CASCADE ) >>> from django.db.models.functions import Greatest >>> blog = Blog . objects . create ( body = "Greatest is the best." ) >>> comment = Comment . objects . create ( body = "N ... o, Least is better." , blog = blog ) >>> comments = Comment . objects . annotate ( last_updated = Greatest ( "modified" , "blog__modified" )) >>> annotated_comment = comments . get () annotated_comment.last_updated は blog.modifi ... ... . objects . order_by ( Collate ( "name" , "et-x-icu" )) <QuerySet [<Author: Ursula>, <Author: Veronika>, <Author: Ülle>]> Greatest ¶ class Greatest ( * expressions , ** extra ) [ソース] ¶ 少なくとも2つのフィールド名または式のリストを受け取り、最大値を返 ... now = True ) blog = models . ForeignKey ( Blog , on_delete = models . CASCADE ) >>> from django.db.models.functions import Greatest >>> blog = Blog . objects . create ( body = "Greatest is the best." ) >>> comment = Comment . objects . create ( body = "N ... o, Least is better." , blog = blog ) >>> comments = Comment . objects . annotate ( last_updated = Greatest ( "modified" , "blog__modified" )) >>> annotated_comment = comments . get () annotated_comment.last_updated は blog.modifi ... ... as DurationField . Added the date lookup to DateTimeField to allow querying the field by only the date portion. Added the Greatest and Least database functions. Added the Now database function, which returns the current date and time. Transform is now a ... ... as DurationField . Added the date lookup to DateTimeField to allow querying the field by only the date portion. Added the Greatest and Least database functions. Added the Now database function, which returns the current date and time. Transform is now a ... ... delAdmin (django.contrib.gis.admin のクラス) GistIndex (django.contrib.postgres.indexes のクラス) gml (OGRGeometry の属性) Greatest (django.db.models.functions のクラス) GROUP (WindowFrameExclusion の属性) groups (models.User の属性) gt field lookup type ... ... delAdmin (django.contrib.gis.admin のクラス) GistIndex (django.contrib.postgres.indexes のクラス) gml (OGRGeometry の属性) Greatest (django.db.models.functions のクラス) GROUP (WindowFrameExclusion の属性) groups (models.User の属性) gt field lookup type ... 2026年10月08日