Is there any downside to using something like
from django.db.models.loading import get_model
def get_something():
model = get_model('app', 'Model')
return model.something()
instead of
from app.models import Model
def get_something():
return Model.something()
The second example can lead to circular dependencies while the first example does not, but the second example is seen much more often.
Update: You would get circular dependency errors if the second example was in a model called Other_Model and Model imported Other_Model as well -- a simple circular import.
get_object_or_404(Model, pk=pk)