... ckedInline [ソース] GenericInlineModelAdmin のサブクラスで、それぞれスタックレイアウトと表形式のレイアウトを持っています。 GenericPrefetch() class GenericPrefetch ( lookup , querysets , to_attr = None ) [ソース] このルックアップは Prefetch() に類似しており、 Ge ... を受け入れます。これは、結果が均質でない GenericForeignKey に便利です。 >>> from django.contrib.contenttypes.prefetch import GenericPrefetch >>> bookmark = Bookmark . objects . create ( url = "https://www.djangoproject.com/" ) >>> animal = Animal . objects . crea ... content_object = bookmark ) >>> TaggedItem . objects . create ( tag = "awesome" , content_object = animal ) >>> prefetch = GenericPrefetch ( ... "content_object" , [ Bookmark . objects . all (), Animal . objects . only ( "name" )] ... ) >>> TaggedItem . objects ... ... 更すると、マイグレーションがクラッシュする原因になっていました ( #35422 )。 Django 5.0 で発見された1つのバグを修正しました。 GenericPrefetch の querysets 引数が必須ではありませんでした ( #35426 )。 ... ... min (django.contrib.contenttypes.admin のクラス) GenericIPAddressField (django.db.models のクラス) (django.forms のクラス) GenericPrefetch (django.contrib.contenttypes.prefetch のクラス) GenericRelation (django.contrib.contenttypes.fields のクラス) GenericSitem ... ... クトの事前読み込みが可能になります。 GenericForeignKey の事前読み込みもサポートしていますが、各 ContentType のクエリセットを GenericPrefetch の querysets パラメータで指定する必要があります。 例えば、以下のようなモデルがあると考えます: from django.db import models ... 2026年10月08日