Add south introspection for TimeZoneField #19

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

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 TimeZoneFields.

@treyhunner treyhunner closed this Jun 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment