brosner/django-timezones — pull request #19 by treyhunner (2012-04-20 04:10:27+00:00)
Title: Add south introspection for TimeZoneField

This is another alternative style to pull request #13.

Another alternative in a more usual style for South introspection code (may be less appropriate for this project's style):

# 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\."])

I think South introspection code always looks ugly, but some sort of introspection is necessary for South to work at all with `TimeZoneField`s.