South introspection rules for TimeZoneFields

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
from timezones.fields import TimeZoneField
from timezones.zones import PRETTY_TIMEZONE_CHOICES
from south.modelsinspector import add_introspection_rules
import settings

add_introspection_rules(rules=[
        ((TimeZoneField,),
        [],
        {
            "default": ["default", {"default": settings.TIME_ZONE}],
            "choices": ["choices", {"default": PRETTY_TIMEZONE_CHOICES}],
            "max_length": ["max_length", {"default":getattr(settings, "MAX_TIMEZONE_LENGTH", 100)}],
        }
        )
    ],
    patterns=[ 'timezones\.fields', ])

More like this

  1. UTC DateTime field by ludo 5 years, 9 months ago
  2. Log username in Apache access logs by arthur 3 years, 2 months ago
  3. Timezone choice field for select box by jmunro 1 year, 2 months ago
  4. Database migration and dump/load script by akaihola 6 years, 1 month ago
  5. astimezone template tag by whardier 2 years, 2 months ago

Comments

(Forgotten your password?)