django-model-utils
django-model-utils copied to clipboard
Using of JoinManager leads to RuntimeError
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:
- Documentation update: always require to add "model_utils" to
INSTALLED_APP
OR - Documentation update: add note to JoinManager, that it's usage requires "model_utils" in
INSTALLED_APP
OR - 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