Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix south introspection rule for custom AssetField

  • Loading branch information...
commit 486633791bea00c6a846b88124860efbc7532433 1 parent edadcdf
Sebastian Vetter elbaschid authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 fancypages/assets/fields.py
9 fancypages/assets/fields.py
View
@@ -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"])
Please sign in to comment.
Something went wrong with that request. Please try again.