per page, with , order by , clip by
Results of 1 - 10 of about 346 for objects (0.016 sec.)
データベース関数 — Django 6.1 ドキュメント 8274
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » データベース関数 ¶ The classes documented below provide a way for users to use functions provided by the underlying database as annotations, aggrega ... 更します。 使用例: >>> from django.db.models import FloatField >>> from django.db.models.functions import Cast >>> Author . objects . create ( age = 25 , name = "Margaret Smith" ) >>> author = Author . objects . annotate ( ... age_as_float = Cast ( "age" ... least to most public >>> from django.db.models import Sum >>> from django.db.models.functions import Coalesce >>> Author . objects . create ( name = "Margaret Smith" , goes_by = "Maggie" ) >>> author = Author . objects . annotate ( screen_name = Coalesc ... e Sum() from returning None >>> # The aggregate default argument uses Coalesce() under the hood. >>> aggregated = Author . objects . aggregate ( ... combined_age = Sum ( "age" ), ... combined_age_default = Sum ( "age" , default = 0 ), ... combined_age_c ...
https://man.mtool.work/django/6.1/ref/models/database-functions.html
データベース関数 — Django 6.1 ドキュメント 8274
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » データベース関数 ¶ The classes documented below provide a way for users to use functions provided by the underlying database as annotations, aggrega ... 更します。 使用例: >>> from django.db.models import FloatField >>> from django.db.models.functions import Cast >>> Author . objects . create ( age = 25 , name = "Margaret Smith" ) >>> author = Author . objects . annotate ( ... age_as_float = Cast ( "age" ... least to most public >>> from django.db.models import Sum >>> from django.db.models.functions import Coalesce >>> Author . objects . create ( name = "Margaret Smith" , goes_by = "Maggie" ) >>> author = Author . objects . annotate ( screen_name = Coalesc ... e Sum() from returning None >>> # The aggregate default argument uses Coalesce() under the hood. >>> aggregated = Author . objects . aggregate ( ... combined_age = Sum ( "age" ), ... combined_age_default = Sum ( "age" , default = 0 ), ... combined_age_c ...
https://man.mtool.work/django/6.1/ref/models/database-functions.html
QuerySet API リファレンス — Django 6.1 ドキュメント 8139
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » QuerySet API リファレンス ¶ このドキュメントでは、 QuerySet API の詳細を説明しています。 モデル と データベースクエリ ガイドにある説明を前提としてい ... スのクエリを実行します。たとえば、これはデータベースにある全エントリのheadline属性を出力するプログラムです: for e in Entry . objects . all (): print ( e . headline ) メモ: 1つ以上の結果が存在するかどうかを判定したいだけなら、これは使わないでください。 exi ... た方が効率的です。 非同期イテレーション. QuerySet は async for を使ってイテレートすることもできます: async for e in Entry . objects . all (): results . append ( e ) クエリセットの同期的・非同期的イテレータは、同じキャッシュを共有します。 スライス。 Query ... ッドを提供しています。 list()。 list() を呼び出すことで、 QuerySet の評価を強制します。たとえば: entry_list = list ( Entry . objects . all ()) bool()。 bool() , or , and または if 文を使用してブール値として QuerySet をテストすると、クエリが実行されます。 ...
https://man.mtool.work/django/6.1/ref/models/querysets.html
クエリを作成する — Django 6.1 ドキュメント 8139
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » クエリを作成する ¶ 一度 データモデル を作成すれば、Django はデータオブジェクトの作成、取得、更新および削除を行えるようにデータベースを抽象化した API ... ると仮定しています(したがって、以下でそれらを取得できます)。 >>> from blog.models import Blog , Entry >>> entry = Entry . objects . get ( pk = 1 ) >>> cheese_blog = Blog . objects . get ( name = "Cheddar Talk" ) >>> entry . blog = cheese_blog >>> entry ... では、 Author インスタンス joe を entry オブジェクトに追加しています: >>> from blog.models import Author >>> joe = Author . objects . create ( name = "Joe" ) >>> entry . authors . add ( joe ) 複数のレコードを ManyToManyField に一気に追加するには、 add() ... の呼び出しに複数の引数を含めてください: >>> john = Author . objects . create ( name = "John" ) >>> paul = Author . objects . create ( name = "Paul" ) >>> george = Author . objects . create ( ...
https://man.mtool.work/django/6.1/topics/db/queries.html
QuerySet API リファレンス — Django 6.1 ドキュメント 8139
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » QuerySet API リファレンス ¶ このドキュメントでは、 QuerySet API の詳細を説明しています。 モデル と データベースクエリ ガイドにある説明を前提としてい ... スのクエリを実行します。たとえば、これはデータベースにある全エントリのheadline属性を出力するプログラムです: for e in Entry . objects . all (): print ( e . headline ) メモ: 1つ以上の結果が存在するかどうかを判定したいだけなら、これは使わないでください。 exi ... た方が効率的です。 非同期イテレーション. QuerySet は async for を使ってイテレートすることもできます: async for e in Entry . objects . all (): results . append ( e ) クエリセットの同期的・非同期的イテレータは、同じキャッシュを共有します。 スライス。 Query ... ッドを提供しています。 list()。 list() を呼び出すことで、 QuerySet の評価を強制します。たとえば: entry_list = list ( Entry . objects . all ()) bool()。 bool() , or , and または if 文を使用してブール値として QuerySet をテストすると、クエリが実行されます。 ...
https://man.mtool.work/django/6.1/ref/models/querysets.html
クエリを作成する — Django 6.1 ドキュメント 8139
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » クエリを作成する ¶ 一度 データモデル を作成すれば、Django はデータオブジェクトの作成、取得、更新および削除を行えるようにデータベースを抽象化した API ... ると仮定しています(したがって、以下でそれらを取得できます)。 >>> from blog.models import Blog , Entry >>> entry = Entry . objects . get ( pk = 1 ) >>> cheese_blog = Blog . objects . get ( name = "Cheddar Talk" ) >>> entry . blog = cheese_blog >>> entry ... では、 Author インスタンス joe を entry オブジェクトに追加しています: >>> from blog.models import Author >>> joe = Author . objects . create ( name = "Joe" ) >>> entry . authors . add ( joe ) 複数のレコードを ManyToManyField に一気に追加するには、 add() ... の呼び出しに複数の引数を含めてください: >>> john = Author . objects . create ( name = "John" ) >>> paul = Author . objects . create ( name = "Paul" ) >>> george = Author . objects . create ( ...
https://man.mtool.work/django/6.1/topics/db/queries.html
PostgreSQL 固有のモデルフィールド — Django 6.1 ドキュメント 7841
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » PostgreSQL 固有のモデルフィールド ¶ これらのフィールドは全て django.contrib.postgres.fields モジュールから利用できます。 これらのフィールドにインデッ ... されるオブジェクトは、渡された値がデータの部分集合であるものです。これは SQL 演算子 @> を使用します。たとえば、: >>> Post . objects . create ( name = "First post" , tags = [ "thoughts" , "django" ]) >>> Post . objects . create ( name = "Second post" , ta ... gs = [ "thoughts" ]) >>> Post . objects . create ( name = "Third post" , tags = [ "tutorial" , "django" ]) >>> Post . objects . filter ( tags__contains = [ "thoug ... hts" ]) <QuerySet [<Post: First post>, <Post: Second post>]> >>> Post . objects . filter ( tags__contains = [ "django" ]) <QuerySet [<Post: First post>, <Post: Third post>]> >>> Post . objects . filter ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/fields.html
PostgreSQL 固有のモデルフィールド — Django 6.1 ドキュメント 7841
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » PostgreSQL 固有のモデルフィールド ¶ これらのフィールドは全て django.contrib.postgres.fields モジュールから利用できます。 これらのフィールドにインデッ ... されるオブジェクトは、渡された値がデータの部分集合であるものです。これは SQL 演算子 @> を使用します。たとえば、: >>> Post . objects . create ( name = "First post" , tags = [ "thoughts" , "django" ]) >>> Post . objects . create ( name = "Second post" , ta ... gs = [ "thoughts" ]) >>> Post . objects . create ( name = "Third post" , tags = [ "tutorial" , "django" ]) >>> Post . objects . filter ( tags__contains = [ "thoug ... hts" ]) <QuerySet [<Post: First post>, <Post: Second post>]> >>> Post . objects . filter ( tags__contains = [ "django" ]) <QuerySet [<Post: First post>, <Post: Third post>]> >>> Post . objects . filter ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/fields.html
多対一 (many-to-one) 関係 — Django 6.1 ドキュメント 7408
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 多対一 (many-to-one) 関係 ¶ 多対一のリレーションシップを定義するには ForeignKey を使います。 この例では、 Reporter は複数の Article オブジェクトと関 ... が発生します。 >>> r3 = Reporter ( first_name = "John" , last_name = "Smith" , email = "john@example.com" ) >>> Article . objects . create ( ... headline = "This is a test" , pub_date = date ( 2005 , 7 , 27 ), reporter = r3 ... ) Traceback (most recent ... cle . reporter <Reporter: John Smith> >>> new_article . reporter . id 1 新しい記事を作成する: >>> new_article2 = Article . objects . create ( ... headline = "Paul's story" , pub_date = date ( 2006 , 1 , 17 ), reporter = r ... ) >>> new_article2 . report ... s" ) <QuerySet [<Article: This is a test>]> # Find all Articles for any Reporter whose first name is "John". >>> Article . objects . filter ( reporter__first_name = "John" ) <QuerySet [<Article: John's second story>, <Article: This is a test>]> これは完 ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_one.html
多対一 (many-to-one) 関係 — Django 6.1 ドキュメント 7381
Django 6.1 ドキュメント Home | Table of contents | Index | Modules « previous | up | next » 多対一 (many-to-one) 関係 ¶ 多対一のリレーションシップを定義するには ForeignKey を使います。 この例では、 Reporter は複数の Article オブジェクトと関 ... が発生します。 >>> r3 = Reporter ( first_name = "John" , last_name = "Smith" , email = "john@example.com" ) >>> Article . objects . create ( ... headline = "This is a test" , pub_date = date ( 2005 , 7 , 27 ), reporter = r3 ... ) Traceback (most recent ... cle . reporter <Reporter: John Smith> >>> new_article . reporter . id 1 新しい記事を作成する: >>> new_article2 = Article . objects . create ( ... headline = "Paul's story" , pub_date = date ( 2006 , 1 , 17 ), reporter = r ... ) >>> new_article2 . report ... s" ) <QuerySet [<Article: This is a test>]> # Find all Articles for any Reporter whose first name is "John". >>> Article . objects . filter ( reporter__first_name = "John" ) <QuerySet [<Article: John's second story>, <Article: This is a test>]> これは完 ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_one.html
PREV 1 2 3 4 5 6 7 8 9 10 NEXT