File tree Expand file tree Collapse file tree 3 files changed +31
-9
lines changed Expand file tree Collapse file tree 3 files changed +31
-9
lines changed Original file line number Diff line number Diff line change
1
+ from __future__ import unicode_literals
2
+
3
+ from django .db import models
4
+ from simple_history .models import HistoricalRecords
5
+
6
+
7
+ class AbstractExternal (models .Model ):
8
+ history = HistoricalRecords (inherit = True )
9
+
10
+ class Meta :
11
+ abstract = True
12
+ app_label = 'external'
Original file line number Diff line number Diff line change @@ -10,11 +10,3 @@ class ExternalModel2(models.Model):
10
10
11
11
class Meta :
12
12
app_label = 'external'
13
-
14
-
15
- class AbstractExternal (models .Model ):
16
- history = HistoricalRecords (inherit = True )
17
-
18
- class Meta :
19
- abstract = True
20
- app_label = 'external'
Original file line number Diff line number Diff line change 1
1
from __future__ import unicode_literals
2
2
3
3
from django .db import models
4
+ from django import VERSION
4
5
5
6
from simple_history .models import HistoricalRecords
6
7
from simple_history import register
7
8
8
9
from .custom_user .models import CustomUser as User
9
- from .external .models .model2 import AbstractExternal
10
+
11
+ try :
12
+ from django .apps import apps
13
+ except ImportError : # Django < 1.7
14
+ from django .db .models import get_model
15
+ else :
16
+ get_model = apps .get_model
17
+
18
+ # 1.6 has different way of importing models
19
+ if VERSION [:3 ] >= (1 , 7 , 0 ):
20
+ from .external .models .model1 import AbstractExternal
21
+ else :
22
+ class AbstractExternal (models .Model ):
23
+ history = HistoricalRecords (inherit = True )
24
+
25
+ class Meta :
26
+ abstract = True
27
+ app_label = 'external'
10
28
11
29
12
30
class Poll (models .Model ):
You can’t perform that action at this time.
0 commit comments