Commits

Andrew Godwin  committed f9e7f77

Fixed #676: timezones introspection plugin

  • Participants
  • Parent commits 0479ec3

Comments (0)

Files changed (2)

 South.egg-info/*
 # Ignore test log
 south/tests/test.log
+# Vim swap files
+*.swp
 
 # Also ignore Sphinx files
 syntax: regexp

File south/introspection_plugins/django_timezones.py

+from south.modelsinspector import add_introspection_rules
+from django.conf import settings
+
+if "timezones" in settings.INSTALLED_APPS:
+    try:
+        from timezones.fields import TimeZoneField
+    except ImportError:
+        pass
+    else:
+        rules = [
+            (
+                (TimeZoneField, ),
+                [],
+                {
+                    "blank": ["blank", {"default": True}],
+                    "max_length": ["max_length", {"default": 100}],
+                },
+            ),
+        ]
+        add_introspection_rules(rules, ["^timezones\.fields",])
+