mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #8210 and #8664: moved USStateField
and PhoneNumberField
to django.contrib.localflavor.us
. This is a backwards-incompatible change, albeit a minor one; just add an aditional import
and go on your way.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4f225d44ce
commit
3a18002bbd
14 changed files with 53 additions and 48 deletions
|
@ -625,13 +625,14 @@ model.
|
|||
|
||||
For example, this model has a few custom methods::
|
||||
|
||||
from django.contrib.localflavor.us.models import USStateField
|
||||
class Person(models.Model):
|
||||
first_name = models.CharField(max_length=50)
|
||||
last_name = models.CharField(max_length=50)
|
||||
birth_date = models.DateField()
|
||||
address = models.CharField(max_length=100)
|
||||
city = models.CharField(max_length=50)
|
||||
state = models.USStateField() # Yes, this is America-centric...
|
||||
state = USStateField() # Yes, this is America-centric...
|
||||
|
||||
def baby_boomer_status(self):
|
||||
"Returns the person's baby-boomer status."
|
||||
|
|
|
@ -73,10 +73,6 @@ the full list of conversions:
|
|||
``TimeField`` ``TimeField``
|
||||
``URLField`` ``URLField`` with ``verify_exists`` set
|
||||
to the model field's ``verify_exists``
|
||||
``USStateField`` ``CharField`` with
|
||||
``widget=USStateSelect``
|
||||
(``USStateSelect`` is from
|
||||
``django.contrib.localflavor.us``)
|
||||
``XMLField`` ``CharField`` with ``widget=Textarea``
|
||||
=============================== ========================================
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue