Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add south introspection for TimeZoneField #19

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+13 −0
Split
View
@@ -155,3 +155,16 @@ 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)
+
+
+# Add south introspection for TimeZoneField
+try:
+ from south.modelsinspector import add_introspection_rules
+except ImportError:
+ pass
+else:
+ add_introspection_rules(rules=[((TimeZoneField,), [], {
+ "max_length": ["max_length", {"default": MAX_TIMEZONE_LENGTH}],
+ "default": ["default", {"default": settings.TIME_ZONE}],
+ "choices": ["choices", {"default": zones.PRETTY_TIMEZONE_CHOICES}],
+ })], patterns=["^timezones\.fields\."])