Skip to content

Commit

Permalink
Added compatability for south
Browse files Browse the repository at this point in the history
  • Loading branch information
macro1 committed Oct 18, 2014
1 parent a9bf75c commit e135955
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions simple_history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
from datetime import datetime
now = datetime.now
from django.utils.translation import string_concat
try:
from south.modelsinspector import add_introspection_rules
except ImportError:
pass
else:
add_introspection_rules([], ["^simple_history.models.CustomForeignKeyField"])
from .manager import HistoryDescriptor

registered_models = {}
Expand Down Expand Up @@ -286,8 +292,7 @@ def do_related_class(self, other, cls):
try:
instance_type = cls.instance_type
except AttributeError: # when model is reconstituted for migration
if cls.__module__ != "__fake__": # not from migrations, error
raise
pass # happens during migrations
else:
self.related = RelatedObject(other, instance_type, self)
transform_field(field)
Expand Down

0 comments on commit e135955

Please sign in to comment.