per page, with , order by , clip by
Results of 1 - 10 of about 38 for books (0.004 sec.)
アグリゲーション (集計) — Django 6.1 ドキュメント 11336
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » アグリゲーション (集計) ¶ Djangoのデータベース抽象API のトピックガイドでは、個別のオブジェクトの作成、取得、削除を行うDjangoのクエリの使い方を説明し ... . CASCADE ) pubdate = models . DateField () class Store ( models . Model ): name = models . CharField ( max_length = 300 ) books = models . ManyToManyField ( Book ) チートシート ¶ お急ぎですか? 上のモデルを使った場合の一般的な集計クエリは以下のようにな ... ります: # Total number of books. >>> Book . objects . count () 2452 # Total number of books with publisher=BaloneyPress >>> Book . objects . filter ( publ ... isher__name = "BaloneyPress" ) . count () 73 # Average price across all books, provide default to be returned instead # of None if no books exist. >>> from django.db.models import Avg >>> Book . objec ...
https://man.mtool.work/django/6.1/topics/db/aggregation.html
アグリゲーション (集計) — Django 6.1 ドキュメント 11336
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » アグリゲーション (集計) ¶ Djangoのデータベース抽象API のトピックガイドでは、個別のオブジェクトの作成、取得、削除を行うDjangoのクエリの使い方を説明し ... . CASCADE ) pubdate = models . DateField () class Store ( models . Model ): name = models . CharField ( max_length = 300 ) books = models . ManyToManyField ( Book ) チートシート ¶ お急ぎですか? 上のモデルを使った場合の一般的な集計クエリは以下のようにな ... ります: # Total number of books. >>> Book . objects . count () 2452 # Total number of books with publisher=BaloneyPress >>> Book . objects . filter ( publ ... isher__name = "BaloneyPress" ) . count () 73 # Average price across all books, provide default to be returned instead # of None if no books exist. >>> from django.db.models import Avg >>> Book . objec ...
https://man.mtool.work/django/6.1/topics/db/aggregation.html
マイグレーション — Django 6.1 ドキュメント 11274
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » マイグレーション ¶ マイグレーション (Migrations) は、Django でモデルに対して行った変更 (フィールドの追加やモデルの削除など) をデータベーススキーマに ... クトが開発できるようにして、複雑さを除くようにデザインされているからです。 ワークフロー ¶ The examples in this section use a books app with the following models: from django.db import models class Author ( models . Model ): name = models . CharField ( m ... 除するなど、モデルに変更を加えてから、 makemigrations を実行してください。 $ python manage.py makemigrations Migrations for 'books' : books/migrations/0003_auto.py: ~ Alter field author on book すると、あなたが書いたモデルがスキャンされ、現在のバージョン ... りに変更が行われるように、データベースに適用します: $ python manage.py migrate Operations to perform: Apply all migrations: books Running migrations: Applying books.0003_auto... OK マイグレーションを適用したら、マイグレーションとモデルの変更をバージョン ...
https://man.mtool.work/django/6.1/topics/migrations.html
マイグレーション — Django 6.1 ドキュメント 11226
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » マイグレーション ¶ マイグレーション (Migrations) は、Django でモデルに対して行った変更 (フィールドの追加やモデルの削除など) をデータベーススキーマに ... クトが開発できるようにして、複雑さを除くようにデザインされているからです。 ワークフロー ¶ The examples in this section use a books app with the following models: from django.db import models class Author ( models . Model ): name = models . CharField ( m ... 除するなど、モデルに変更を加えてから、 makemigrations を実行してください。 $ python manage.py makemigrations Migrations for 'books' : books/migrations/0003_auto.py: ~ Alter field author on book すると、あなたが書いたモデルがスキャンされ、現在のバージョン ... りに変更が行われるように、データベースに適用します: $ python manage.py migrate Operations to perform: Apply all migrations: books Running migrations: Applying books.0003_auto... OK マイグレーションを適用したら、マイグレーションとモデルの変更をバージョン ...
https://man.mtool.work/django/6.1/topics/migrations.html
組み込みのクラスベースのジェネリックビュー(汎用ビュー) — Django 6.1 ドキュメ... 10346
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 組み込みのクラスベースのジェネリックビュー(汎用ビュー) ¶ ウェブアプリケーションを書くのは、特定のパターンを何度も繰り返すことになるため、単調になり ... tion_date = models . DateField () 次に、ビューを定義しましょう。 # views.py from django.views.generic import ListView from books.models import Publisher class PublisherListView ( ListView ): model = Publisher 最後に、このビューを URL にフックさせます。 ... # urls.py from django.urls import path from books.views import PublisherListView urlpatterns = [ path ( "publishers/" , PublisherListView . as_view ()), ] 書く必要のある Py ... 書くこともできますが、この属性を省略した場合でも、Django はオブジェクト名から推論してくれます。この場合は、テンプレート名は "books/publisher_list.html" になります。"books" の部分はモデルを定義したアプリの名前から来ていますが、"publisher" の部分はモデル名 ...
https://man.mtool.work/django/6.1/topics/class-based-views/generic-display.html
組み込みのクラスベースのジェネリックビュー(汎用ビュー) — Django 6.1 ドキュメ... 10299
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 組み込みのクラスベースのジェネリックビュー(汎用ビュー) ¶ ウェブアプリケーションを書くのは、特定のパターンを何度も繰り返すことになるため、単調になり ... tion_date = models . DateField () 次に、ビューを定義しましょう。 # views.py from django.views.generic import ListView from books.models import Publisher class PublisherListView ( ListView ): model = Publisher 最後に、このビューを URL にフックさせます。 ... # urls.py from django.urls import path from books.views import PublisherListView urlpatterns = [ path ( "publishers/" , PublisherListView . as_view ()), ] 書く必要のある Py ... 書くこともできますが、この属性を省略した場合でも、Django はオブジェクト名から推論してくれます。この場合は、テンプレート名は "books/publisher_list.html" になります。"books" の部分はモデルを定義したアプリの名前から来ていますが、"publisher" の部分はモデル名 ...
https://man.mtool.work/django/6.1/topics/class-based-views/generic-display.html
Fetch modes — Django 6.1 ドキュメント 9764
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 ... . Use QuerySet.fetch_mode() to set the fetch mode for model instances fetched by a QuerySet : from django.db import models books = Book . objects . fetch_mode ( models . FETCH_PEERS ) Fetch modes apply to: ForeignKey fields OneToOneField fields and th ... ( models . Model ): author = models . ForeignKey ( Author , on_delete = models . CASCADE ) ... …and this loop: for book in books : print ( book . author . name ) …where books is a QuerySet of Book instances using some fetch mode. FETCH_ONE ¶ Fetches t ... for the current instance only. This is the default mode. Using FETCH_ONE for the above example 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 patte ...
https://man.mtool.work/django/6.1/topics/db/fetch-modes.html
Fetch modes — Django 6.1 ドキュメント 9607
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 ... . Use QuerySet.fetch_mode() to set the fetch mode for model instances fetched by a QuerySet : from django.db import models books = Book . objects . fetch_mode ( models . FETCH_PEERS ) Fetch modes apply to: ForeignKey fields OneToOneField fields and th ... ( models . Model ): author = models . ForeignKey ( Author , on_delete = models . CASCADE ) ... …and this loop: for book in books : print ( book . author . name ) …where books is a QuerySet of Book instances using some fetch mode. FETCH_ONE ¶ Fetches t ... for the current instance only. This is the default mode. Using FETCH_ONE for the above example 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 patte ...
https://man.mtool.work/django/6.1/topics/db/fetch-modes.html
PostgreSQL 固有のクエリ式 — Django 6.1 ドキュメント 9167
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » PostgreSQL 固有のクエリ式 ¶ これらの式は django.contrib.postgres.expressions モジュールから利用できます。 ArraySubquery() 式 ¶ class ArraySubquery ( ... >> from django.db.models.functions import JSONObject >>> from django.contrib.postgres.expressions import ArraySubquery >>> books = Book . objects . filter ( author = OuterRef ( "pk" )) . values ( ... json = JSONObject ( title = "title" , pages = "page ... s" ) ... ) >>> author = Author . objects . annotate ( books = ArraySubquery ( books )) . first () >>> author . books [{'title': 'Solaris', 'pages': 204}, {'title': 'The Cyberiad', 'p ... のトピックへ PostgreSQL 固有のデータベース制約 次のトピックへ PostgreSQL 固有のモデルフィールド 関連キーワード ArraySubquery books title pages クエリ import author PostgreSQL contrib postgres expressions セット 構築 values models OuterRef JSONObject obj ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/expressions.html
PostgreSQL 固有のクエリ式 — Django 6.1 ドキュメント 9072
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » PostgreSQL 固有のクエリ式 ¶ これらの式は django.contrib.postgres.expressions モジュールから利用できます。 ArraySubquery() 式 ¶ class ArraySubquery ( ... >> from django.db.models.functions import JSONObject >>> from django.contrib.postgres.expressions import ArraySubquery >>> books = Book . objects . filter ( author = OuterRef ( "pk" )) . values ( ... json = JSONObject ( title = "title" , pages = "page ... s" ) ... ) >>> author = Author . objects . annotate ( books = ArraySubquery ( books )) . first () >>> author . books [{'title': 'Solaris', 'pages': 204}, {'title': 'The Cyberiad', 'p ... クへ PostgreSQL 固有のデータベース制約 次のトピックへ PostgreSQL 固有のモデルフィールド 関連キーワード ArraySubquery django books title pages クエリ import author PostgreSQL contrib postgres expressions セット リスト 構築 values 必要 db models OuterRef ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/expressions.html
PREV 1 2 3 4 NEXT