diff --git a/django/contrib/localflavor/__init__.py b/django/contrib/localflavor/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/django/contrib/localflavor/usa/__init__.py b/django/contrib/localflavor/usa/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/django/newforms/extras/usa.py b/django/contrib/localflavor/usa/forms.py similarity index 100% rename from django/newforms/extras/usa.py rename to django/contrib/localflavor/usa/forms.py diff --git a/docs/add_ons.txt b/docs/add_ons.txt index d937eb2141..1756fe5720 100644 --- a/docs/add_ons.txt +++ b/docs/add_ons.txt @@ -139,6 +139,15 @@ See the `flatpages documentation`_. .. _flatpages documentation: ../flatpages/ +localflavor +=========== + +**New in Django development version** + +A collection of various Django snippets that are useful only for a particular +country or culture. For example, ``django.contrib.localflavor.usa.forms`` +contains a ``USZipCodeField`` that you can use to validate U.S. zip codes. + markup ====== diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py index 080131ad01..5c360a7272 100644 --- a/tests/regressiontests/forms/tests.py +++ b/tests/regressiontests/forms/tests.py @@ -3225,7 +3225,7 @@ True USZipCodeField validates that the data is either a five-digit U.S. zip code or a zip+4. ->>> from django.newforms.extras.usa import USZipCodeField +>>> from django.contrib.localflavor.usa.forms import USZipCodeField >>> f = USZipCodeField() >>> f.clean('60606') u'60606'