Ticket #2455: usstates.patch

File usstates.patch, 1.9 KB (added by anonymous, 18 years ago)
  • __init__.py

     
    764764        return [forms.URLField]
    765765
    766766class USStateField(Field):
     767    US_STATE_CHOICES = (
     768      ('AL', 'Alabama'), ('AK', 'Alaska'), ('AS', 'American Samoa'),
     769      ('AZ', 'Arizona'), ('AR', 'Arkansas'), ('CA', 'California'),
     770      ('CO', 'Colorado'), ('CT', 'Connecticut'), ('DE', 'Delaware'),
     771      ('DC', 'District Of Columbia'), ('FM', 'Federated States of Micronesia'),
     772      ('FL', 'Flordia'),  ('GA', 'Georgia'), ('GU', 'Guam'), ('HI', 'Hawaii'),
     773      ('ID', 'Idaho'), ('IL', 'Illinois'), ('IN', 'Indiana'), ('IA', 'Iowa'),
     774      ('KS', 'Kansas'), ('KY', 'Kentucky'), ('LA', 'Louisiana'),
     775      ('ME', 'Maine'), ('MH', 'Marshall Islands'), ('MD', 'Maryland'),
     776      ('MA', 'Massachusetts'), ('MI', 'Michigan'), ('MN', 'Minnesota'),
     777      ('MS', 'Mississippi'), ('MO', 'Missouri'), ('MT', 'Montana'),
     778      ('NE', 'Nebraska'), ('NV', 'Nevada'), ('NH', 'New Hampshire'),
     779      ('NJ', 'New Jersey'), ('NM', 'New Mexico'), ('NY', 'New York'),
     780      ('NC', 'North Carolina'), ('ND', 'North Dakota'),
     781      ('MP', 'Northern Mariana Islands'), ('OH', 'Ohio'), ('OK', 'Oklahoma'),
     782      ('OR', 'Oregon'), ('PW', 'Palau'), ('PA', 'Pennsylvania'),
     783      ('PR', 'Puerto Rico'), ('RI', 'Rhode Island'), ('SC', 'South Carolina'),
     784      ('SD', 'South Dakota'), ('TN', 'Tennessee'), ('TX', 'Texas'),
     785      ('UT', 'Utah'), ('VT', 'Vermont'), ('VI', 'Virgin Islands'),
     786      ('VA', 'Virginia'), ('WA', 'Washington'), ('WV', 'West Virginia'),
     787      ('WI', 'Wisconsin'), ('WY', 'Wyoming'),
     788    )
     789   
     790    def __init__(self, verbose_name=None, name=None, **kwargs):
     791        Field.__init__(self, verbose_name, name, choices=self.US_STATE_CHOICES, **kwargs)
     792       
    767793    def get_manipulator_field_objs(self):
    768794        return [forms.USStateField]
    769795
Back to Top