Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added support for South to introspect TimeZoneField #13

Open
wants to merge 1 commit into from

10 participants

@sidmitra

No description provided.

@tuttle

+1

@karhidle

+1

@brosner
Owner

Is this still relevant? If so, can the coding style please be cleaned up? See existing coding style.

@groovecoder

Still relevant for sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 11, 2011
  1. @sidmitra
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 0 deletions.
  1. +15 −0 timezones/fields.py
View
15 timezones/fields.py
@@ -155,3 +155,18 @@ def set_dtz_field(instance, dt):
## RED_FLAG: need to add a check at manage.py validation time that
## time_zone value is a valid query keyword (if it is one)
signals.class_prepared.connect(prep_localized_datetime)
+
+
+# allow South to handle TimeZoneField smoothly
+try:
+ from south.modelsinspector import add_introspection_rules
+ add_introspection_rules(rules=[(
+ (TimeZoneField, ), # Class(es) these apply to
+ [], # Positional arguments (not used)
+ { # Keyword argument
+ "max_length": ["max_length", { "default": MAX_TIMEZONE_LENGTH }],
+ }
+ )],
+ patterns=['timezones\.fields\.'])
+except ImportError:
+ pass
Something went wrong with that request. Please try again.