django-model-utils icon indicating copy to clipboard operation
django-model-utils copied to clipboard

Using of JoinManager leads to RuntimeError

Open mark-mishyn opened this issue 5 years ago • 0 comments

JoinManager "raises Model class model_utils.managers.TempModel doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS"

Environment

  • Django Model Utils version: 4.0.0
  • Django version: 2.2.9
  • Python version: 3.6.7
  • Other libraries used, if any: pip freeze shows more than 150 libs

Code examples

Message.objects.all()[0:20].join()
RuntimeError: Model class model_utils.managers.TempModel doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.

Possible solutions:

  1. Documentation update: always require to add "model_utils" to INSTALLED_APP OR
  2. Documentation update: add note to JoinManager, that it's usage requires "model_utils" in INSTALLED_APP OR
  3. Explicitly add TempModel.Meta.app_label = 'model_utils' in model_utils/managers.py

P. S. I hope it will be useful for someone with the same issue

mark-mishyn avatar Dec 24 '19 08:12 mark-mishyn