Skip to content

Commit

Permalink
replaced the utilities in django.db.models.loading (removed in django…
Browse files Browse the repository at this point in the history
… 1.9) in favor of the new application loading system
  • Loading branch information
janezkranjc committed Jun 9, 2015
1 parent ee3cb54 commit ea151a8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions swampdragon/model_tools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from django.db.models.loading import get_model as get_django_model

try:
from django.apps import apps
get_django_model = apps.get_model
except ImportError:
from django.db.models.loading import get_model as get_django_model

def get_property(obj, field):
field = field.replace('__', '.')
Expand Down

0 comments on commit ea151a8

Please sign in to comment.