2010-08-07 00:18:10 +08:00
|
|
|
from django.db import models
|
|
|
|
from django.contrib.localflavor.us.models import USStateField
|
2010-12-23 10:56:31 +08:00
|
|
|
from django.contrib.localflavor.us.models import USPostalCodeField
|
2010-08-07 00:18:10 +08:00
|
|
|
|
|
|
|
# When creating models you need to remember to add a app_label as
|
|
|
|
# 'localflavor', so your model can be found
|
|
|
|
|
|
|
|
class USPlace(models.Model):
|
|
|
|
state = USStateField(blank=True)
|
|
|
|
state_req = USStateField()
|
|
|
|
state_default = USStateField(default="CA", blank=True)
|
2010-12-23 10:56:31 +08:00
|
|
|
postal_code = USPostalCodeField(blank=True)
|
2010-08-07 00:18:10 +08:00
|
|
|
name = models.CharField(max_length=20)
|
2011-07-29 18:20:16 +08:00
|
|
|
|
2010-08-07 00:18:10 +08:00
|
|
|
class Meta:
|
|
|
|
app_label = 'localflavor'
|