From 3a18002bbd3b08fb3ee40d681bdda1a39eb0ad9c Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Mon, 1 Sep 2008 22:15:35 +0000 Subject: 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 --- docs/ref/contrib/localflavor.txt | 5 +++++ docs/ref/models/fields.txt | 8 -------- docs/topics/db/models.txt | 3 ++- docs/topics/forms/modelforms.txt | 4 ---- 4 files changed, 7 insertions(+), 13 deletions(-) (limited to 'docs') diff --git a/docs/ref/contrib/localflavor.txt b/docs/ref/contrib/localflavor.txt index 5a3fed34c6..25b60de2d0 100644 --- a/docs/ref/contrib/localflavor.txt +++ b/docs/ref/contrib/localflavor.txt @@ -649,3 +649,8 @@ United States of America (``us``) A form ``Select`` widget that uses a list of U.S. states/territories as its choices. + +.. class:: us.models.USStateField + + A model field that forms represent as a ``forms.USStateField`` field and + stores the two-letter U.S. state abbreviation in the database. diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index f5c8f72356..5f656da66a 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -705,14 +705,6 @@ Like all ::class:`CharField` subclasses, :class:`URLField` takes the optional :attr:`~CharField.max_length`argument. If you don't specify :attr:`~CharField.max_length`, a default of 200 is used. -``USStateField`` ----------------- - -.. class:: USStateField([**options]) - -A two-letter U.S. state abbreviation. The admin represents this as an ```` (a single-line input). - ``XMLField`` ------------ diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt index 645d643a05..9418bf6004 100644 --- a/docs/topics/db/models.txt +++ b/docs/topics/db/models.txt @@ -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." diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index fe1e053d50..80857aea9a 100644 --- a/docs/topics/forms/modelforms.txt +++ b/docs/topics/forms/modelforms.txt @@ -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`` =============================== ======================================== -- cgit v1.3