per page, with , order by , clip by
Results of 1 - 10 of about 53 for exists (0.004 sec.)
クエリ式 (Query Expression) 14184
クエリ式 (Query Expression) クエリ式 (query expression) は、update、create、filter、order by、annotation、またはaggregateの一部として使用できる値または計算を記述します。式が真偽値を出力する場合、フィルタで直接使用できます。クエリの記述に使用 ... jects . order_by ( "name__length" ) # Boolean expression can be used directly in filters. >>> from django.db.models import Exists , OuterRef >>> Company . objects . filter ( ... Exists ( Employee . objects . filter ( company = OuterRef ( "pk" ), salary ... ます。 (スライスの代わりに get() を使うと、 Subquery 内でクエリセットが使われるまで OuterRef が解決できないため失敗します) Exists() サブクエリ class Exists ( queryset ) [ソース] Exists は SQL の EXISTS ステートメントを使う サブクエリ のサブクラスです。 ... とえば、各投稿に直近1日以内のコメントがあるかどうかのアノテーションを付けることができます: >>> from django.db.models import Exists , OuterRef >>> from datetime import timedelta >>> from django.utils import timezone >>> one_day_ago = timezone . now () - ...
https://man.mtool.work/django/6.1/ref/models/expressions.html
条件式 10418
条件式 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 ... ith = "Paul" ), then = "name" ) >>> # Condition can be created using boolean expressions. >>> from django.db.models import Exists , OuterRef >>> non_unique_account_type = ( ... Client . objects . filter ( ... account_type = OuterRef ( "account_type" ), ... ... ) ... . exclude ( pk = OuterRef ( "pk" )) ... . values ( "pk" ) ... ) >>> When ( Exists ( non_unique_account_type ), then = Value ( "non unique" )) >>> # Condition can be created using lookup expressions. >>> f ... count_type" ), ... ) ... . exclude ( pk = OuterRef ( "pk" )) ... . values ( "pk" ) ... ) >>> Client . objects . filter ( ~ Exists ( non_unique_account_type )) SQL文では、次のように評価されます: SELECT ... FROM client c0 WHERE NOT EXISTS ( SELECT c1 . i ...
https://man.mtool.work/django/6.1/ref/models/conditional-expressions.html
Django 3.2.1 リリースノート 10418
Django 3.2.1 リリースノート May 4, 2021 Django 3.2.1 fixes a security issue and several bugs in 3.2. CVE-2021-31542: Potential directory-traversal via uploaded files MultiPartParser , UploadedFile , and FieldFile allowed directory-traversal ... g queryset bitwise combination when used with subqueries that began manifesting in Django 3.2, due to a separate fix using Exists to exclude() multi-valued relationships ( #32650 ). Fixed a bug in Django 3.2 where variable lookup errors were logged whe ... st would crash when deleting objects filtered against multi-valued relationships ( #32682 ). The admin changelist now uses Exists() instead of QuerySet.distinct() because calling delete() after distinct() is not allowed in Django 3.2 to address a data ...
https://man.mtool.work/django/6.1/releases/3.2.1.html
Django 1.8.3 リリースノート 9332
Django 1.8.3 リリースノート July 8, 2015 Django 1.8.3 fixes several security issues and bugs in 1.8.2. Also, django.utils.deprecation.RemovedInDjango20Warning was renamed to RemovedInDjango110Warning as the version roadmap was revised to 1. ... RLField form fields which use these validators all strip the input, so the possibility of newlines entering your data only exists if you are using these validators outside of the form fields. The undocumented, internally unused validate_integer() funct ... d crash during makemigrations if a migrations module either is missing __init__.py or is a file ( #24848 ). Fixed QuerySet.exists() returning incorrect results after annotation with Count() ( #24835 ). Corrected HStoreField.has_changed() ( #24844 ). Re ...
https://man.mtool.work/django/6.1/releases/1.8.3.html
Django 3.0.2 リリースノート 9332
Django 3.0.2 リリースノート 2020年1月2日 Django 3.0.2 では、3.0.1 にあったいくつかのバグを修正しました。 バグ修正 Fixed a regression in Django 3.0 that didn't include columns referenced by a Subquery() in the GROUP BY clause ( #31094 ). Fix ... ed a regression in Django 3.0 where QuerySet.exists() crashed if a queryset contained an aggregation over a Subquery() ( #31109 ). Fixed a regression in Django 3.0 that cause ...
https://man.mtool.work/django/6.1/releases/3.0.2.html
QuerySet API リファレンス 9064
QuerySet API リファレンス このドキュメントでは、 QuerySet API の詳細を説明しています。 モデル と データベースクエリ ガイドにある説明を前提としていますので、このドキュメントを読む前にこの 2 つを読んでおくことをおすすめします。 このリファレン ... cts . all (): print ( e . headline ) メモ: 1つ以上の結果が存在するかどうかを判定したいだけなら、これは使わないでください。 exists() を使った方が効率的です。 非同期イテレーション. QuerySet は async for を使ってイテレートすることもできます: async for e i ... もしクエリの結果が少なくとも1つ存在するかどうかを確認したいだけであれば(そして実際のオブジェクトを必要としないのであれば)、 exists() を使うべきです。 QuerySet の Pickle 化 QuerySet を pickle 化するとき、pickle化の前にすべての結果がメモリにロードされるよ ... der_by ( "name" ) In addition, only LIMIT , OFFSET , COUNT(*) , ORDER BY , and specifying columns (i.e. slicing, count() , exists() , order_by() , and values() / values_list() ) are allowed on the resulting QuerySet . Further, databases place restricti ...
https://man.mtool.work/django/6.1/ref/models/querysets.html
Django 2.0.4 リリースノート 9064
Django 2.0.4 リリースノート 2018年4月2日 Django 2.0.4 では、2.0.3 にあったいくつかのバグを修正しました。 バグ修正 Fixed a crash when filtering with an Exists() annotation of a queryset containing a single field ( #29195 ). Fixed admin autoc ...
https://man.mtool.work/django/6.1/releases/2.0.4.html
Django 5.1.7 リリースノート 8796
Django 5.1.7 リリースノート 2025年3月6日 Django 5.1.7 では、 5.1.6 における深刻度 "moderate" のセキュリティの問題1件と、いくつかのバグを修正しました。 CVE-2025-26699: django.utils.text.wrap() における潜在的な DoS 攻撃の脆弱性 The wrap() and ... t to True , did not truncate the overwritten file content ( #36191 ). Fixed a regression in Django 5.1 where the count and exists methods of ManyToManyField related managers would always return 0 and False when the intermediary model back references us ...
https://man.mtool.work/django/6.1/releases/5.1.7.html
Django 3.0.7 リリースノート 8528
Django 3.0.7 リリースノート June 3, 2020 Django 3.0.7 では、3.0.6 の2つのセキュリティの問題といくつかのバグを修正しました。 CVE-2020-13254: Potential data leakage via malformed memcached keys In cases where a memcached backend does not perf ... a regression in Django 3.0 where QuerySet.values() and values_list() crashed if a queryset contained an aggregation and an Exists() annotation on Oracle ( #31584 ). Fixed a regression in Django 3.0 where all resolved Subquery() expressions were conside ...
https://man.mtool.work/django/6.1/releases/3.0.7.html
ModelAdmin リストフィルタ 8260
ModelAdmin リストフィルタ ModelAdmin クラスは、以下のスクリーンショットのように、admin アプリケーションの変更一覧ページの右サイドバーに表示されるリストフィルタを定義できます: フィールドごとのフィルタリングを有効にするには、 ModelAdmin.list_ ... _queryset ( request ) if qs . filter ( birthday__gte = date ( 1980 , 1 , 1 ), birthday__lte = date ( 1989 , 12 , 31 ), ) . exists (): yield ( "80s" , _ ( "in the eighties" )) if qs . filter ( birthday__gte = date ( 1990 , 1 , 1 ), birthday__lte = date ... ( 1999 , 12 , 31 ), ) . exists (): yield ( "90s" , _ ( "in the nineties" )) フィールド名と明示的な FieldListFilter を使用する 最後に、フィールドに使用する ...
https://man.mtool.work/django/6.1/ref/contrib/admin/filters.html
PREV 1 2 3 4 5 6 NEXT