Not sure, but I think this may be a bug?
Here is my model:
class Property(models.Model):
Name = models.CharField(max_length=40)
Description = models.TextField(default="Description Not Available")
Address = models.CharField(max_length=60, default="Not Available")
Address2 = models.CharField(max_length=60,null=True)
City = models.CharField(max_length=60, null=True)
State = usa_model.USStateField(null=True)
Code = usa_model.USPostalCodeField(null=True)
Phone = usa_model.PhoneNumberField(null=True)
Am I missing something?
-Kerry
Perhaps you are looking for the US Zip Code Form Field?
The USPostalCodeField
uses a list of the states + a few extras:
COFA_STATES = (
('FM', 'Federated States of Micronesia'),
('MH', 'Marshall Islands'),
('PW', 'Palau'),
)
At django.contrib.localflavor.us.us_states
# USStateField
STATE_CHOICES = tuple(sorted(US_STATES + US_TERRITORIES + ARMED_FORCES_STATES, key=lambda obj: obj[1]))
# USPostalCodeField
USPS_CHOICES = tuple(sorted(US_STATES + US_TERRITORIES + ARMED_FORCES_STATES + COFA_STATES, key=lambda obj: obj[1]))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With