From 27b28616b405578d81fb8e6a4efdc73459c81a2b Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 15 Feb 2007 05:53:44 +0000 Subject: [PATCH] Created django.contrib.localflavor, for country- and culture-specific functionality. Moved django/newforms/extras/usa.py into there git-svn-id: http://code.djangoproject.com/svn/django/trunk@4524 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/localflavor/__init__.py | 0 django/contrib/localflavor/usa/__init__.py | 0 .../extras/usa.py => contrib/localflavor/usa/forms.py} | 0 docs/add_ons.txt | 9 +++++++++ tests/regressiontests/forms/tests.py | 2 +- 5 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 django/contrib/localflavor/__init__.py create mode 100644 django/contrib/localflavor/usa/__init__.py rename django/{newforms/extras/usa.py => contrib/localflavor/usa/forms.py} (100%) 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'