... 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 ... 2026年10月08日