ContentType.objects.get(app_label="app_name", model="model_name")
является только возвращаемым экземпляром класса модели ContentType . Но
apps.get_model('app_name', 'model_name')
возврат модель класса из 'app_name', 'model_name'
подробнее в коде:
In [1]: from django.contrib.contenttypes.models import ContentType
In [2]: from django.apps import apps
In [3]: ct = ContentType.objects.get(app_label="myapp", model="bar")
In [4]: Bar = apps.get_model("myapp.bar")
In [5]: ct == Bar
Out[5]: False
In [6]: ct.model_class() == Bar
Out[6]: True
In [7]: Bar.objects.count()
Out[7]: 3
In [8]: ct.objects.count()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-8-c27dfd7c7cf5> in <module>()
----> 1 ct.objects.count()
/home/user/.virtualenvs/so/local/lib/python2.7/site-packages/django/db/models/manager.pyc in __get__(self, instance, cls)
184 def __get__(self, instance, cls=None):
185 if instance is not None:
--> 186 raise AttributeError("Manager isn't accessible via %s instances" % cls.__name__)
187
188 if cls._meta.abstract:
AttributeError: Manager isn't accessible via ContentType instances