per page, with , order by , clip by
Results of 1 - 10 of about 30 for startswith (0.005 sec.)
多対一 (many-to-one) 関係 13662
多対一 (many-to-one) 関係 多対一のリレーションシップを定義するには ForeignKey を使います。 この例では、 Reporter は複数の Article オブジェクトと関連付けることができますが、 Article は一つの Reporter オブジェクトしか持つことができません: fro ... コアを使用してください。これは、好きなだけ深くできます。制限はありません。たとえば: >>> r . article_set . filter ( headline__startswith = "This" ) <QuerySet [<Article: This is a test>]> # Find all Articles for any Reporter whose first name is "John". >>> Art ... objects . filter ( article = a ) <QuerySet [<Reporter: John Smith>]> >>> Reporter . objects . filter ( article__headline__startswith = "This" ) <QuerySet [<Reporter: John Smith>, <Reporter: John Smith>, <Reporter: John Smith>]> >>> Reporter . objects . fi ... lter ( article__headline__startswith = "This" ) . distinct () <QuerySet [<Reporter: John Smith>]> 逆方向のカウントは distinct() と連動して動作します: >>> Repor ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_one.html
多対多 (many-to-many) 関係 12476
多対多 (many-to-many) 関係 多対多の関係を定義するには、 ManyToManyField を使用します。 この例では、一つの Article は複数の Publication オブジェクトに掲載することができ、一つの Publication は複数の Article オブジェクトを持ちます: from django ... jango lets you build web apps easily>, <Article: NASA uses Python>]> >>> Article . objects . filter ( publications__title__startswith = "Science" ) <QuerySet [<Article: NASA uses Python>, <Article: NASA uses Python>]> >>> Article . objects . filter ( publi ... cations__title__startswith = "Science" ) . distinct () <QuerySet [<Article: NASA uses Python>]> count() 関数は distinct() も尊重します: >>> Article . ... objects . filter ( publications__title__startswith = "Science" ) . count () 2 >>> Article . objects . filter ( publications__title__startswith = "Science" ) . distinct () . ...
https://man.mtool.work/django/6.1/topics/db/examples/many_to_many.html
クエリを作成する 11128
クエリを作成する 一度 データモデル を作成すれば、Django はデータオブジェクトの作成、取得、更新および削除を行えるようにデータベースを抽象化した API を自動的に提供します。本ドキュメントではこの API をどのように用いるかを説明します。多様なモデ ... 、複数のフィルタを連結することが可能です。たとえば、次のように書くことができます。 >>> Entry . objects . filter ( headline__startswith = "What" ) . exclude ( ... pub_date__gte = datetime . date . today () ... ) . filter ( pub_date__gte = datetime . date ( 2 ... に独立した QuerySet が作られるため、保存したり何度も再利用したりできます。 例: >>> q1 = Entry . objects . filter ( headline__startswith = "What" ) >>> q2 = q1 . exclude ( pub_date__gte = datetime . date . today ()) >>> q3 = q1 . filter ( pub_date__gte = date ... 価される までは、Django は実際にはクエリを実行しません。次の例を見てください。 >>> q = Entry . objects . filter ( headline__startswith = "What" ) >>> q = q . filter ( pub_date__lte = datetime . date . today ()) >>> q = q . exclude ( body_text__icontains = " ...
https://man.mtool.work/django/6.1/topics/db/queries.html
一対一 (one-to-one) 関係 9942
一対一 (one-to-one) 関係 一対一の関係を定義するには、 OneToOneField を使用します。 この例では、 Place は任意で Restaurant になることができます: from django.db import models class Place ( models . Model ): name = models . CharField ( max_len ... . objects . get ( place__pk = 1 ) <Restaurant: Demon Dogs the restaurant> >>> Restaurant . objects . filter ( place__name__startswith = "Demon" ) <QuerySet [<Restaurant: Demon Dogs the restaurant>]> >>> Restaurant . objects . exclude ( place__address__cont ... lace . objects . get ( restaurant = r ) <Place: Demon Dogs the place> >>> Place . objects . get ( restaurant__place__name__startswith = "Demon" ) <Place: Demon Dogs the place> 場所を削除した場合、そのレストランは削除されます ( OneToOneField が on_delete に ... QuerySet [<Waiter: Joe the waiter at Demon Dogs the restaurant>]> >>> Waiter . objects . filter ( restaurant__place__name__startswith = "Demon" ) <QuerySet [<Waiter: Joe the waiter at Demon Dogs the restaurant>]> ...
https://man.mtool.work/django/6.1/topics/db/examples/one_to_one.html
Django 1.10 リリースノート 9438
Django 1.10 リリースノート 2016年8月1日 Django 1.10 へようこそ! このリリースノートでは、 バージョン 1.10 の新機能 と、Django 1.9 以前からアップグレードする際に注意が必要な 後方互換性が失われた変更点 について説明します。私たちは、非推奨の期間 ... jango.contrib.auth import get_user_model User = get_user_model () # Unsalted MD5/SHA1: User . objects . filter ( password__startswith = "md5$$" ) User . objects . filter ( password__startswith = "sha1$$" ) # Salted MD5/SHA1: User . objects . filter ( passw ... ord__startswith = "md5$" ) . exclude ( password__startswith = "md5$$" ) User . objects . filter ( password__startswith = "sha1$" ) . exclu ... de ( password__startswith = "sha1$$" ) # Crypt hasher: User . objects . filter ( password__startswith = "crypt$$" ) from django.db.models import Cha ...
https://man.mtool.work/django/6.1/releases/1.10.html
条件式 8253
条件式 Conditional expressions let you use if ... elif ... else logic within filters, annotations, aggregations, and updates. A conditional expression evaluates a series of conditions for each row of a table and returns the matching result ... , 1 , 1 ), ... then = "account_type" , ... ) >>> # Complex conditions can be created using Q objects >>> When ( Q ( name__startswith = "John" ) | Q ( name__startswith = "Paul" ), then = "name" ) >>> # Condition can be created using boolean expressions. >> ...
https://man.mtool.work/django/6.1/ref/models/conditional-expressions.html
Django 2.2.1 リリースノート 8253
Django 2.2.1 リリースノート May 1, 2019 Django 2.2.1 fixes several bugs in 2.2. バグ修正 Fixed a regression in Django 2.1 that caused the incorrect quoting of database user password when using dbshell on Oracle ( #30307 ). Added compatibili ... StatReloader ( #30323 ). Fixed a migration crash on Oracle and PostgreSQL when adding a check constraint with a contains , startswith , or endswith lookup (or their case-insensitive variant) ( #30408 ). Fixed a migration crash on Oracle and SQLite when add ...
https://man.mtool.work/django/6.1/releases/2.2.1.html
Django のショートカット関数 8253
Django のショートカット関数 django.shortcuts パッケージは、MVC の複数のレベルにまたがるヘルパー関数とクラスを集めたものです。言い換えれば、これらの関数やクラスは、便宜上、控えめな結合を取り入れます。 render() render ( request , template_nam ... ように Model を渡すものです。しかし、 QuerySet インスタンスを渡すこともできます: queryset = Book . objects . filter ( title__startswith = "M" ) get_object_or_404 ( queryset , pk = 1 ) 上の例は下記と等価なので、少し不自然ではあります: get_object_or_404 ( Book ... , title__startswith = "M" , pk = 1 ) しかし、他の場所から QuerySet 変数を渡された場合には便利です。 最後に、 Manager を使うこともできます。これ ...
https://man.mtool.work/django/6.1/topics/http/shortcuts.html
PostgreSQL 固有のモデルフィールド 8090
PostgreSQL 固有のモデルフィールド これらのフィールドは全て django.contrib.postgres.fields モジュールから利用できます。 これらのフィールドにインデックスを付ける Index と Field.db_index は両方とも B-tree インデックスを作成しますが、複雑なデー ... があります。 注釈 キーのトランスフォームは、 contains 、 icontains 、 endswith 、 iendswith 、 iexact 、 regex 、 iregex 、 startswith 、および istartswith ルックアップとも連結できます。 警告 どのような文字列でも hstore 値のキーになり得るので、以下に列挙され ... Event: Soft play>, <Event: Pub trip>]> 境界を使ったクエリ 範囲フィールドはいくつかの追加ルックアップをサポートしています。 startswith 返されるオブジェクトは与えられた下界を持つ。ベースフィールドの有効なルックアップに連結できます。 >>> Event . objects . fil ... ter ( ages__startswith = 21 ) <QuerySet [<Event: Pub trip>]> endswith 返されるオブジェクトは与えられた上限を持つ。ベースフィールドの有効なルックア ...
https://man.mtool.work/django/6.1/ref/contrib/postgres/fields.html
Django の概要 7911
Django の概要 Django は変転の激しいニュースルーム環境で開発された経緯から、よくある Web 開発タスクを迅速かつ簡単化するように設計されています。ここでは Django による データベースを使った Web アプリケーション開発をざっと見てみましょう。 このド ... abase lookup API. >>> Reporter . objects . get ( id = 1 ) <Reporter: John Smith> >>> Reporter . objects . get ( full_name__startswith = "John" ) <Reporter: John Smith> >>> Reporter . objects . get ( full_name__contains = "mith" ) <Reporter: John Smith> >>> ... ar as you need, performing efficient # JOINs for you behind the scenes. # This finds all articles by a reporter whose name starts with "John". >>> Article . objects . filter ( reporter__full_name__startswith = "John" ) <QuerySet [<Article: Django is cool>] ...
https://man.mtool.work/django/6.1/intro/overview.html
PREV 1 2 3 NEXT