per page, with , order by , clip by
Results of 1 - 10 of about 42 for total (0.006 sec.)
フォームセット (Formset) — Django 6.1 ドキュメント 14183
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » フォームセット (Formset) ¶ class BaseFormSet [ソース] ¶ フォームセットは、同じページで複数のフォームを扱うための抽象レイヤーです。データグリッドに例 ... forms import ArticleForm >>> ArticleFormSet = formset_factory ( ArticleForm , absolute_max = 1500 ) >>> data = { ... "form-TOTAL_FORMS" : "1501" , ... "form-INITIAL_FORMS" : "0" , ... } >>> formset = ArticleFormSet ( data ) >>> len ( formset . forms ) ... actory >>> from myapp.forms import ArticleForm >>> ArticleFormSet = formset_factory ( ArticleForm ) >>> data = { ... "form-TOTAL_FORMS" : "1" , ... "form-INITIAL_FORMS" : "0" , ... } >>> formset = ArticleFormSet ( data ) >>> formset . is_valid () True ... フォームセットは十分に賢いので、変更されていない余分なフォームは無視します。無効な記事を提供すると、: >>> data = { ... "form-TOTAL_FORMS" : "2" , ... "form-INITIAL_FORMS" : "0" , ... "form-0-title" : "Test" , ... "form-0-pub_date" : "1904-06-16" , ... " ...
https://man.mtool.work/django/6.1/topics/forms/formsets.html
フォームセット (Formset) — Django 6.1 ドキュメント 13827
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » フォームセット (Formset) ¶ class BaseFormSet [ソース] ¶ フォームセットは、同じページで複数のフォームを扱うための抽象レイヤーです。データグリッドに例 ... forms import ArticleForm >>> ArticleFormSet = formset_factory ( ArticleForm , absolute_max = 1500 ) >>> data = { ... "form-TOTAL_FORMS" : "1501" , ... "form-INITIAL_FORMS" : "0" , ... } >>> formset = ArticleFormSet ( data ) >>> len ( formset . forms ) ... actory >>> from myapp.forms import ArticleForm >>> ArticleFormSet = formset_factory ( ArticleForm ) >>> data = { ... "form-TOTAL_FORMS" : "1" , ... "form-INITIAL_FORMS" : "0" , ... } >>> formset = ArticleFormSet ( data ) >>> formset . is_valid () True ... フォームセットは十分に賢いので、変更されていない余分なフォームは無視します。無効な記事を提供すると、: >>> data = { ... "form-TOTAL_FORMS" : "2" , ... "form-INITIAL_FORMS" : "0" , ... "form-0-title" : "Test" , ... "form-0-pub_date" : "1904-06-16" , ... " ...
https://man.mtool.work/django/6.1/topics/forms/formsets.html
Fetch modes — Django 6.1 ドキュメント 9135
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Fetch modes ¶ New in Django 6.1. When accessing model fields that were not loaded as part of the original query, Django will fetch that field's data ... mple would use: 1 query to fetch books N queries, where N is the number of books, to fetch the missing author field …for a total of 1+N queries. This query pattern is known as the "N+1 queries problem" because it often leads to performance issues when ... e above example would use: 1 query to fetch books 1 query to fetch all missing author fields for the batch of books …for a total of 2 queries. The batch query makes this mode a lot more efficient than FETCH_ONE and is similar to an on-demand call to Q ...
https://man.mtool.work/django/6.1/topics/db/fetch-modes.html
Fetch modes — Django 6.1 ドキュメント 9135
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » Fetch modes ¶ New in Django 6.1. When accessing model fields that were not loaded as part of the original query, Django will fetch that field's data ... mple would use: 1 query to fetch books N queries, where N is the number of books, to fetch the missing author field …for a total of 1+N queries. This query pattern is known as the "N+1 queries problem" because it often leads to performance issues when ... e above example would use: 1 query to fetch books 1 query to fetch all missing author fields for the batch of books …for a total of 2 queries. The batch query makes this mode a lot more efficient than FETCH_ONE and is similar to an on-demand call to Q ...
https://man.mtool.work/django/6.1/topics/db/fetch-modes.html
テンプレートのバックエンドをカスタマイズする — Django 6.1 ドキュメント 8438
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » テンプレートのバックエンドをカスタマイズする ¶ カスタムのバックエンド ¶ ここでは、他のテンプレートシステムを使用するために、カスタムテンプレートバッ ... ンの前のエラー行の内容。 'during' : エラーを発生させたトークン。 'after' : エラーを発生させたトークンの後のエラー行の内容。 'total' : source_lines の行数。 'top' : source_lines が始まる行番号。 'bottom' : source_lines が終了する行番号。 上記のテンプレー ... " ), ( 8 , "" ), ], "line" : 4 , "before" : "Hello " , "during" : "{ % s yntax error %}" , "after" : " {{ world }} \n " , "total" : 9 , "bottom" : 9 , "top" : 1 , } Origin API と サードパーティとの統合 ¶ Djangoテンプレートでは、 template.origin 属性を ...
https://man.mtool.work/django/6.1/howto/custom-template-backend.html
テンプレートのバックエンドをカスタマイズする — Django 6.1 ドキュメント 8438
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » テンプレートのバックエンドをカスタマイズする ¶ カスタムのバックエンド ¶ ここでは、他のテンプレートシステムを使用するために、カスタムテンプレートバッ ... ンの前のエラー行の内容。 'during' : エラーを発生させたトークン。 'after' : エラーを発生させたトークンの後のエラー行の内容。 'total' : source_lines の行数。 'top' : source_lines が始まる行番号。 'bottom' : source_lines が終了する行番号。 上記のテンプレー ... " ), ( 8 , "" ), ], "line" : 4 , "before" : "Hello " , "during" : "{ % s yntax error %}" , "after" : " {{ world }} \n " , "total" : 9 , "bottom" : 9 , "top" : 1 , } Origin API と サードパーティとの統合 ¶ Djangoテンプレートでは、 template.origin 属性を ...
https://man.mtool.work/django/6.1/howto/custom-template-backend.html
アグリゲーション (集計) — Django 6.1 ドキュメント 8268
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » アグリゲーション (集計) ¶ Djangoのデータベース抽象API のトピックガイドでは、個別のオブジェクトの作成、取得、削除を行うDjangoのクエリの使い方を説明し ... ManyToManyField ( Book ) チートシート ¶ お急ぎですか? 上のモデルを使った場合の一般的な集計クエリは以下のようになります: # Total number of books. >>> Book . objects . count () 2452 # Total number of books with publisher=BaloneyPress >>> Book . objects ... -> Book の逆多対多のホップを指定するために 'book' を使用していることに注意してください): >>> Author . objects . annotate ( total_pages = Sum ( "book__pages" )) ( QuerySet に含まれる Author は total_pages 属性を持ちます。別名が指定されなければ、 book__ ...
https://man.mtool.work/django/6.1/topics/db/aggregation.html
アグリゲーション (集計) — Django 6.1 ドキュメント 8268
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » アグリゲーション (集計) ¶ Djangoのデータベース抽象API のトピックガイドでは、個別のオブジェクトの作成、取得、削除を行うDjangoのクエリの使い方を説明し ... ManyToManyField ( Book ) チートシート ¶ お急ぎですか? 上のモデルを使った場合の一般的な集計クエリは以下のようになります: # Total number of books. >>> Book . objects . count () 2452 # Total number of books with publisher=BaloneyPress >>> Book . objects ... -> Book の逆多対多のホップを指定するために 'book' を使用していることに注意してください): >>> Author . objects . annotate ( total_pages = Sum ( "book__pages" )) ( QuerySet に含まれる Author は total_pages 属性を持ちます。別名が指定されなければ、 book__ ...
https://man.mtool.work/django/6.1/topics/db/aggregation.html
クエリ式 (Query Expression) — Django 6.1 ドキュメント 8082
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » クエリ式 (Query Expression) ¶ クエリ式 (query expression) は、update、create、filter、order by、annotation、またはaggregateの一部として使用できる値ま ... Subquery , Sum >>> comments = Comment . objects . filter ( post = OuterRef ( "pk" )) . order_by () . values ( "post" ) >>> total_comments = comments . annotate ( total = Sum ( "length" )) . values ( "total" ) >>> Post . objects . filter ( length__gt = ... Subquery ( total_comments )) 最初の filter(...) はサブクエリを関連するパラメータに制限します。 order_by() は Comment モデルのデフォルトの o ... 。これらのクエリセットメソッドを適用する順番は重要です。この場合、サブクエリは1つのカラムに限定する必要があるため、 values('total') が必要となります。 これは Subquery 内で集計を行う唯一の方法です。 aggregate() を使用すると、クエリセットを評価しようとし ...
https://man.mtool.work/django/6.1/ref/models/expressions.html
クエリ式 (Query Expression) — Django 6.1 ドキュメント 8082
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » クエリ式 (Query Expression) ¶ クエリ式 (query expression) は、update、create、filter、order by、annotation、またはaggregateの一部として使用できる値ま ... Subquery , Sum >>> comments = Comment . objects . filter ( post = OuterRef ( "pk" )) . order_by () . values ( "post" ) >>> total_comments = comments . annotate ( total = Sum ( "length" )) . values ( "total" ) >>> Post . objects . filter ( length__gt = ... Subquery ( total_comments )) 最初の filter(...) はサブクエリを関連するパラメータに制限します。 order_by() は Comment モデルのデフォルトの o ... 。これらのクエリセットメソッドを適用する順番は重要です。この場合、サブクエリは1つのカラムに限定する必要があるため、 values('total') が必要となります。 これは Subquery 内で集計を行う唯一の方法です。 aggregate() を使用すると、クエリセットを評価しようとし ...
https://man.mtool.work/django/6.1/ref/models/expressions.html
PREV 1 2 3 4 5 NEXT