... th , Upper >>> from django.db.models.lookups import GreaterThan # Find companies that have more employees than chairs. >>> Company . objects . filter ( num_employees__gt = F ( "num_chairs" )) # Find companies that have at least twice as many employees # ... as chairs. Both the querysets below are equivalent. >>> Company . objects . filter ( num_employees__gt = F ( "num_chairs" ) * 2 ) >>> Company . objects . filter ( num_employees__gt = F ( ... "num_chairs" ) + F ( "num_chairs" )) # How many chairs are needed for each company to seat all employees? >>> company = ( ... Company . objects . filter ( num_employees__gt = F ( "num_chairs" )) ... . anno ... ... th , Upper >>> from django.db.models.lookups import GreaterThan # Find companies that have more employees than chairs. >>> Company . objects . filter ( num_employees__gt = F ( "num_chairs" )) # Find companies that have at least twice as many employees # ... as chairs. Both the querysets below are equivalent. >>> Company . objects . filter ( num_employees__gt = F ( "num_chairs" ) * 2 ) >>> Company . objects . filter ( num_employees__gt = F ( ... "num_chairs" ) + F ( "num_chairs" )) # How many chairs are needed for each company to seat all employees? >>> company = ( ... Company . objects . filter ( num_employees__gt = F ( "num_chairs" )) ... . anno ... ... たは ManyToManyField のいずれかでなければなりません: class PersonAdmin ( admin . ModelAdmin ): list_filter = [ "is_staff" , "company" ] list_filter 内のフィールド名は __ ルックアップを使って関係先を参照できます。たとえば、次のように参照できます。 class Pe ... rsonAdmin ( admin . UserAdmin ): list_filter = [ "company__name" ] SimpleListFilter を使用する ¶ フィルタリングをカスタマイズするには、 django.contrib.admin.SimpleListFilter をサブ ... ... たは ManyToManyField のいずれかでなければなりません: class PersonAdmin ( admin . ModelAdmin ): list_filter = [ "is_staff" , "company" ] list_filter 内のフィールド名は __ ルックアップを使って関係先を参照できます。たとえば、次のように参照できます。 class Pe ... rsonAdmin ( admin . UserAdmin ): list_filter = [ "company__name" ] SimpleListFilter を使用する ¶ フィルタリングをカスタマイズするには、 django.contrib.admin.SimpleListFilter をサブ ... ... nt' に設定できます。 そして、Jinja2 テンプレートで以下の構文を使用できるようになります: < img src = " {{ static ( 'path/to/company-logo.png' ) }} " alt = "Company Logo" > < a href = " {{ url ( 'admin:index' ) }} " > Administration </ a > タグとフィルタの ... ... nt' に設定できます。 そして、Jinja2 テンプレートで以下の構文を使用できるようになります: < img src = " {{ static ( 'path/to/company-logo.png' ) }} " alt = "Company Logo" > < a href = " {{ url ( 'admin:index' ) }} " > Administration </ a > タグとフィルタの ... ... ass attribute. A new django.test.SimpleTestCase subclass of unittest.TestCase that's lighter than django.test.TestCase and company. It can be useful in tests that don't need to hit a database. See Django ユニットテストクラスの階層 . Backwards incompatib ... ... s ¶ Email addresses allow a "friendly" display name alongside the user@domain address. For example, you could include your company name in the DEFAULT_FROM_EMAIL setting: DEFAULT_FROM_EMAIL = '"Example, Inc." <contact@example.com>' The double quotes aro ... ... ass attribute. A new django.test.SimpleTestCase subclass of unittest.TestCase that's lighter than django.test.TestCase and company. It can be useful in tests that don't need to hit a database. See Django ユニットテストクラスの階層 . Backwards incompatib ... ... s ¶ Email addresses allow a "friendly" display name alongside the user@domain address. For example, you could include your company name in the DEFAULT_FROM_EMAIL setting: DEFAULT_FROM_EMAIL = '"Example, Inc." <contact@example.com>' The double quotes aro ... 2026年10月08日