... me = models . CharField ( max_length = 300 ) class Book ( models . Model ): name = models . CharField ( max_length = 300 ) pages = models . IntegerField () price = models . DecimalField ( max_digits = 10 , decimal_places = 2 ) rating = models . FloatF ... k の逆多対多のホップを指定するために 'book' を使用していることに注意してください): >>> Author . objects . annotate ( total_pages = Sum ( "book__pages" )) ( QuerySet に含まれる Author は total_pages 属性を持ちます。別名が指定されなければ、 book__pages_ ... . 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_pag ... ... me = models . CharField ( max_length = 300 ) class Book ( models . Model ): name = models . CharField ( max_length = 300 ) pages = models . IntegerField () price = models . DecimalField ( max_digits = 10 , decimal_places = 2 ) rating = models . FloatF ... k の逆多対多のホップを指定するために 'book' を使用していることに注意してください): >>> Author . objects . annotate ( total_pages = Sum ( "book__pages" )) ( QuerySet に含まれる Author は total_pages 属性を持ちます。別名が指定されなければ、 book__pages_ ... . 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_pag ... ... ery >>> books = Book . objects . filter ( author = OuterRef ( "pk" )) . values ( ... json = JSONObject ( title = "title" , pages = "pages" ) ... ) >>> author = Author . objects . annotate ( books = ArraySubquery ( books )) . first () >>> author . book ... s [{'title': 'Solaris', 'pages': 204}, {'title': 'The Cyberiad', 'pages': 295}] 目次 PostgreSQL 固有のクエリ式 ArraySubquery() 式 前のトピックへ PostgreS ... QL 固有のデータベース制約 次のトピックへ PostgreSQL 固有のモデルフィールド 関連キーワード ArraySubquery books title pages クエリ import author PostgreSQL contrib postgres expressions セット 構築 values models OuterRef JSONObject objects 固有 qu ... ... ery >>> books = Book . objects . filter ( author = OuterRef ( "pk" )) . values ( ... json = JSONObject ( title = "title" , pages = "pages" ) ... ) >>> author = Author . objects . annotate ( books = ArraySubquery ( books )) . first () >>> author . book ... s [{'title': 'Solaris', 'pages': 204}, {'title': 'The Cyberiad', 'pages': 295}] 目次 PostgreSQL 固有のクエリ式 ArraySubquery() 式 前のトピックへ PostgreS ... QL 固有のデータベース制約 次のトピックへ PostgreSQL 固有のモデルフィールド 関連キーワード ArraySubquery django books title pages クエリ import author PostgreSQL contrib postgres expressions セット リスト 構築 values 必要 db models OuterRef 関連するペー ... ... of leaving the items on a page by themselves. For example, with 23 items, per_page=10 , and orphans=3 , there will be two pages; the first page with 10 items and the second (and last) page with 13 items. orphans defaults to zero, which means pages ar ... h_side = 3 , on_ends = 2 ) [ソース] ¶ Paginator.page_range に似た1から始まるページ番号のリストを返しますが、 Paginator.num_pages が大きい場合は、現在のページ番号のどちらか一方または両方に省略記号を追加します。 現在のページ番号の両側に含めるページ数は ... st) を使用します。これにより、 QuerySet などのオブジェクトは、より効率的な count() メソッドを使用できます。 Paginator. num_pages [ソース] ¶ トータルのページ数 Paginator. page_range [ソース] ¶ 1から始まるページ数の範囲のイテレータです。たとえば、 [1, 2 ... ... of leaving the items on a page by themselves. For example, with 23 items, per_page=10 , and orphans=3 , there will be two pages; the first page with 10 items and the second (and last) page with 13 items. orphans defaults to zero, which means pages ar ... h_side = 3 , on_ends = 2 ) [ソース] ¶ Paginator.page_range に似た1から始まるページ番号のリストを返しますが、 Paginator.num_pages が大きい場合は、現在のページ番号のどちらか一方または両方に省略記号を追加します。 現在のページ番号の両側に含めるページ数は ... st) を使用します。これにより、 QuerySet などのオブジェクトは、より効率的な count() メソッドを使用できます。 Paginator. num_pages [ソース] ¶ トータルのページ数 Paginator. page_range [ソース] ¶ 1から始まるページ数の範囲のイテレータです。たとえば、 [1, 2 ... ... nator >>> objects = [ "john" , "paul" , "george" , "ringo" ] >>> p = Paginator ( objects , 2 ) >>> p . count 4 >>> p . num_pages 2 >>> type ( p . page_range ) <class 'range'> >>> p . page_range range(1, 3) >>> page1 = p . page ( 1 ) >>> page1 <Page 1 ... ge2 . object_list ['george', 'ringo'] >>> page2 . has_next () False >>> page2 . has_previous () True >>> page2 . has_other_pages () True >>> page2 . next_page_number () Traceback (most recent call last): ... EmptyPage : That page contains no results > ... mber }} " > previous </ a > {% endif %} < span class = "current" > Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} . </ span > {% if page_obj.has_next %} < a href = "?page= {{ page_obj.next_page_number }} " > next </ a > < a href = "? ... ... -only fields in the admin ( #33077 ). Fixed a regression in Django 3.2 that caused incorrect selection of items across all pages when actions were placed both on the top and bottom of the admin change-list view ( #33083 ). 目次 Django 3.2.8 リリースノ ... xed caused incorrect admin リリースノート October fixes bugs バグ 修正 links read fields regression selection items across pages actions were placed bottom change list view クイック検索 Last update: 2026年10月09日 « previous | up | next » ... ... ツフィールドは空のままにしておくこともできます。カスタムテンプレートにコンテンツを入れる場合に便利です。 インストール ¶ flatpages アプリをインストールするには、以下の手順に従ってください: もし設定にまだ含まれていない場合は、 'django.contrib.sites' をあ ... s フレームワークを使用している場合は、別のサイトの ID になる可能性があります) 。 INSTALLED_APPS 設定に 'django.contrib.flatpages' を追加してください。 そして、下記のいずれかを行います: URLconf にエントリを追加します。例えば、次のようにします: urlpatte ... rns = [ path ( "pages/" , include ( "django.contrib.flatpages.urls" )), ] または: django.contrib.flatpages.middleware.FlatpageFallbackMiddleware ... ... nator >>> objects = [ "john" , "paul" , "george" , "ringo" ] >>> p = Paginator ( objects , 2 ) >>> p . count 4 >>> p . num_pages 2 >>> type ( p . page_range ) <class 'range'> >>> p . page_range range(1, 3) >>> page1 = p . page ( 1 ) >>> page1 <Page 1 ... ge2 . object_list ['george', 'ringo'] >>> page2 . has_next () False >>> page2 . has_previous () True >>> page2 . has_other_pages () True >>> page2 . next_page_number () Traceback (most recent call last): ... EmptyPage : That page contains no results > ... mber }} " > previous </ a > {% endif %} < span class = "current" > Page {{ page_obj.number }} of {{ page_obj.paginator.num_pages }} . </ span > {% if page_obj.has_next %} < a href = "?page= {{ page_obj.next_page_number }} " > next </ a > < a href = "? ... 2026年10月08日