File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import django
8
8
from django .db import models , router
9
- from django .db .models import loading
9
+ try :
10
+ from django .apps import apps
11
+ get_app = apps .get_app
12
+ except (ImportError , AttributeError ):
13
+ from django .db .models .loading import get_app
10
14
from django .db .models .fields .proxy import OrderWrt
11
15
from django .db .models .fields .related import RelatedField
12
16
from django .conf import settings
@@ -103,7 +107,7 @@ def create_history_model(self, model):
103
107
elif app_module != self .module :
104
108
if apps is None : # Django < 1.7
105
109
# has meta options with app_label
106
- app = loading . get_app (model ._meta .app_label )
110
+ app = get_app (model ._meta .app_label )
107
111
attrs ['__module__' ] = app .__name__ # full dotted name
108
112
else :
109
113
# Abuse an internal API because the app registry is loading.
You can’t perform that action at this time.
0 commit comments