Skip to content

Commit

Permalink
update models.py imports for new application loading system
Browse files Browse the repository at this point in the history
  • Loading branch information
bwademackevision committed Apr 28, 2015
1 parent fbd23bf commit 3d56042
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions simple_history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

import django
from django.db import models, router
from django.db.models import loading
try:
from django.apps import apps
get_app = apps.get_app
except (ImportError, AttributeError):
from django.db.models.loading import get_app
from django.db.models.fields.proxy import OrderWrt
from django.db.models.fields.related import RelatedField
from django.conf import settings
Expand Down Expand Up @@ -103,7 +107,7 @@ def create_history_model(self, model):
elif app_module != self.module:
if apps is None: # Django < 1.7
# has meta options with app_label
app = loading.get_app(model._meta.app_label)
app = get_app(model._meta.app_label)
attrs['__module__'] = app.__name__ # full dotted name
else:
# Abuse an internal API because the app registry is loading.
Expand Down

0 comments on commit 3d56042

Please sign in to comment.