Skip to content

Commit fbd23bf

Browse files
get_model method import update for django 1.8 in management.commands.populate_history
1 parent d7827c3 commit fbd23bf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

simple_history/management/commands/populate_history.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
from optparse import make_option
22
from django.core.management.base import BaseCommand, CommandError
3-
from django.db.models.loading import get_model
4-
3+
try:
4+
from django.apps import apps
5+
get_model = apps.get_model
6+
except (ImportError, AttributeError): # django 1.6 compatibility
7+
from django.db.models.loading import get_model
58
from ... import models
69
from . import _populate_utils as utils
710

0 commit comments

Comments
 (0)