... 性があります。これは 2 つの方法で解決できます: >>> When ( then__exact = 0 , then = 1 ) >>> When ( Q ( then = 0 ), then = 1 ) Case ¶ class Case ( * cases , ** extra ) [ソース] ¶ Case() 式は Python の if ... elif ... else 文のようなものです。指定された W ... オブジェクトの result 式が返されます。 例: >>> >>> from datetime import date , timedelta >>> from django.db.models import Case , Value , When >>> Client . objects . create ( ... name = "Jane Doe" , ... account_type = Client . REGULAR , ... registere ... ), ... ) >>> # Get the discount for each Client based on the account type >>> Client . objects . annotate ( ... discount = Case ( ... When ( account_type = Client . GOLD , then = Value ( "5%" )), ... When ( account_type = Client . PLATINUM , then = V ... ... 性があります。これは 2 つの方法で解決できます: >>> When ( then__exact = 0 , then = 1 ) >>> When ( Q ( then = 0 ), then = 1 ) Case ¶ class Case ( * cases , ** extra ) [ソース] ¶ Case() 式は Python の if ... elif ... else 文のようなものです。指定された W ... オブジェクトの result 式が返されます。 例: >>> >>> from datetime import date , timedelta >>> from django.db.models import Case , Value , When >>> Client . objects . create ( ... name = "Jane Doe" , ... account_type = Client . REGULAR , ... registere ... ), ... ) >>> # Get the discount for each Client based on the account type >>> Client . objects . annotate ( ... discount = Case ( ... When ( account_type = Client . GOLD , then = Value ( "5%" )), ... When ( account_type = Client . PLATINUM , then = V ... ... to that account. バグ修正 ¶ Fixed check for template engine alias uniqueness ( #24685 ). Fixed crash when reusing the same Case instance in a query ( #24752 ). Corrected join promotion for Case expressions. For example, annotating a query with a Case ... expression could unexpectedly filter out results ( #24766 ). Fixed negated Q objects in expressions. Cases like Case(When(~Q(friends__age__lte=30))) tried to generate a subquery which resulted in a crash ( #24705 ). Fixed incorr ... トピックへ Django 1.8.3 リリースノート 次のトピックへ Django 1.8.1 リリースノート 関連キーワード session Fixed empty cookie Case contrib account query ForeignKey database cached backend flush users their auth user logged flushed 修正 crash expressions ... ... to that account. バグ修正 ¶ Fixed check for template engine alias uniqueness ( #24685 ). Fixed crash when reusing the same Case instance in a query ( #24752 ). Corrected join promotion for Case expressions. For example, annotating a query with a Case ... expression could unexpectedly filter out results ( #24766 ). Fixed negated Q objects in expressions. Cases like Case(When(~Q(friends__age__lte=30))) tried to generate a subquery which resulted in a crash ( #24705 ). Fixed incorr ... .8.3 リリースノート 次のトピックへ Django 1.8.1 リリースノート 関連キーワード session Fixed Django key empty string cookie Case db contrib account query ForeignKey database cached backend flush set users their 関連するページ Django 1.7.10 リリースノー ... ... s from Transifex are incorporated. Minor feature ¶ The new LiveServerTestCase.port attribute reallows the use case of binding to a specific port following the bind to port zero change in Django 1.11. ... ed the ImageField file extension validation added in Django 1.11 from the model field to the form field to reallow the use case of storing images without an extension ( #28242 ). 目次 Django 1.11.2 リリースノート Minor feature バグ修正 前のトピックへ ... スノート 次のトピックへ Django 1.11.1 リリースノート 関連キーワード Fixed crash model port detection regression feature use case contrib rather utils safe invalid fields argument adding validation added create reallow date extension リリースノート Jun ... ... s from Transifex are incorporated. Minor feature ¶ The new LiveServerTestCase.port attribute reallows the use case of binding to a specific port following the bind to port zero change in Django 1.11. ... ed the ImageField file extension validation added in Django 1.11 from the model field to the form field to reallow the use case of storing images without an extension ( #28242 ). 目次 Django 1.11.2 リリースノート Minor feature バグ修正 前のトピックへ ... クへ Django 1.11.1 リリースノート 関連キーワード Fixed Django crash model port detection django regression field feature use case contrib rather utils safe invalid fields argument adding validation 関連するページ Django 1.8.6 リリースノート Django 1.7. ... ... Fixed recording of applied status for squashed (replacement) migrations ( #24628 ). Fixed queryset annotations when using Case expressions with exclude() ( #24833 ). Corrected join promotion for multiple Case expressions. Annotating a query with mul ... tiple Case expressions could unexpectedly filter out results ( #24924 ). Fixed usage of transforms in subqueries ( #24744 ). Fixed Si ... mpleTestCase.assertRaisesMessage() on Python 2.7.10 ( #24903 ). Provided better backwards compatibility for the verbosity argument in o ... ... フィルタリングを行う際に発生していたクラッシュを修正しました( #36522 )。 Django 5.2 において、 GeneratedField や Q および Case ルックアップで構成された制約を使用するモデルを検証する際に発生していたクラッシュを修正しました( #36518 )。 docutils 0.22 ... グ 複合 モデル リリースノート 外部 QuerySet bulk create PostgreSQL 戦略 リグレッション タプル フィルタリング GeneratedField Case ルックアップ 構成 制約 検証 docutils 互換性 ManyToManyField クイック検索 Last update: 2026年10月09日 « previous | up | nex ... ... Fixed recording of applied status for squashed (replacement) migrations ( #24628 ). Fixed queryset annotations when using Case expressions with exclude() ( #24833 ). Corrected join promotion for multiple Case expressions. Annotating a query with mul ... tiple Case expressions could unexpectedly filter out results ( #24924 ). Fixed usage of transforms in subqueries ( #24744 ). Fixed Si ... mpleTestCase.assertRaisesMessage() on Python 2.7.10 ( #24903 ). Provided better backwards compatibility for the verbosity argument in o ... ... uthor email. # AUTHOR LINK --One of the following three is optional. The framework # looks for them in this order. In each case, the URL should include # the scheme (such as "https://") and domain name. def author_link ( self , obj ): """ Takes the o ... author URL. # CATEGORIES -- One of the following three is optional. The framework # looks for them in this order. In each case, the method/attribute # should return an iterable object that returns strings. def categories ( self , obj ): """ Takes th ... email. # ITEM AUTHOR LINK -- One of the following three is optional. The # framework looks for them in this order. In each case, the URL should # include the scheme (such as "https://") and domain name. # # If you specify this, you must specify item_ ... 2026年10月08日