Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added support for South to introspect TimeZoneField #13

Open
wants to merge 1 commit into from

10 participants

Siddharth Mitra roberts81 Adam Charnock luke crouch Vlada Macek Karolina Hidalgo Brian Rosner Olivier Girardot Chris Chambers Igor Davydenko
Siddharth Mitra

No description provided.

Vlada Macek

+1

Karolina Hidalgo

+1

Brian Rosner
Owner

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

luke crouch

Still relevant for sure.

Olivier Girardot

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 11, 2011
  1. Siddharth Mitra
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 0 deletions.
  1. +15 −0 timezones/fields.py
15 timezones/fields.py
View
@@ -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.