Permalink
Browse files

Fix south introspection rule for custom AssetField

  • Loading branch information...
1 parent edadcdf commit 486633791bea00c6a846b88124860efbc7532433 @elbaschid elbaschid committed Jul 16, 2014
Showing with 7 additions and 2 deletions.
  1. +7 −2 fancypages/assets/fields.py
View
9 fancypages/assets/fields.py
@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals, absolute_import
+import django
from django.db.models.fields.related import ForeignKey
from .forms import AssetField
@@ -16,5 +19,7 @@ def value_from_object(self, obj):
return [asset_obj.id, asset_obj._meta.module_name]
-from south.modelsinspector import add_introspection_rules
-add_introspection_rules([], ["^fancypages\.assets\.fields\.AssetKey"])
+# This is only required for Django version < 1.7 suing South for migrations
+if django.VERSION[:2] < (1, 7):
+ from south.modelsinspector import add_introspection_rules
+ add_introspection_rules([], ["^fancypages\.assets\.fields\.AssetKey"])

0 comments on commit 4866337

Please sign in to comment.