per page, with , order by , clip by
Results of 1 - 1 of about 1 for guido (0.001 sec.)
contenttypes フレームワーク 9414
contenttypes フレームワーク Django には contenttypes アプリケーションが含まれており、 Django を使ったプロジェクトにインストールされているすべてのモデルを追跡し、モデルを扱うための高レベルで汎用的なインターフェースを提供します。 概要 content ... ser_type . model_class () <class 'django.contrib.auth.models.User'> >>> user_type . get_object_for_this_type ( username = "Guido" ) <User: Guido> get_object_for_this_type() と model_class() を併用することで、2つの非常に重要なユースケースが可能になりま ... ドに代入したり、 TaggedItem を作成する際に使用したりすることができます: >>> from django.contrib.auth.models import User >>> guido = User . objects . get ( username = "Guido" ) >>> t = TaggedItem ( content_object = guido , tag = "bdfl" ) >>> t . save () ... >>> t . content_object <User: Guido> リレーション先オブジェクトが削除された場合、 content_type フィールドと object_id フィールドは元の値のままとなり、 Generic ...
https://man.mtool.work/django/6.1/ref/contrib/contenttypes.html
PREV 1 NEXT