django.db.models.get_model is deprecated
See original GitHub issueThe alias will be dropped in Django 1.9. Just need to update swapper.load_model
to use django.db.models.loading.get_model
instead.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5
Top Results From Across the Web
Django: Get model from string?
As of Django 1.7 the django.db.models.loading is deprecated (to be removed in 1.9) in favor of the the new application loading system. --...
Read more >Replace use of django.db.models.get_model with ...
caused by utils/app_loading.py importing django.db.models.loading ; that entire module is deprecated. There is a pull request #1137 on this ...
Read more >Model Meta options
A model's database table name is constructed by joining the model's “app label” – the name you used in manage.py startapp – to...
Read more >django-simple-history - Read the Docs
django-simple-history stores Django model state on every create/update/delete. ... changeReason is deprecated and will be removed in version 3.0.0 (gh-655) ...
Read more >django-deprecate-fields
This package allows deprecating model fields and allows removing them in a backwards compatible manner.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using
django.db.models.loading.get_model
gets you a second deprecation warning, so this does not help. But it points in the right direction. Theloading
module has the pointers to the new locations. So you can look inloading.py
to see where you should import it from. In this case you should usedjango.apps.apps.get_model
.Note: I am not using the django-swappable-models project, but this is currently the top link when Googling for
django.db.models.get_model is deprecated.
😃Yes, according to the above comment this was fixed more than three years ago in pull request #9. Looking at the commit this was added already in swapper version 0.3.0.