Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1245b5c

Browse files
Backwards-incompatible change -- Renamed localflavor.usa to localflavor.us to match naming of other flavors.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4954 bcc190cf-cafb-0310-a4f2-bffc1f526a37
1 parent c7f6cd0 commit 1245b5c

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎django/db/models/fields/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ def validate(self, field_data, all_data):
761761
validators.isValidPhone(field_data, all_data)
762762

763763
def formfield(self, **kwargs):
764-
from django.contrib.localflavor.usa.forms import USPhoneNumberField
764+
from django.contrib.localflavor.us.forms import USPhoneNumberField
765765
defaults = {'required': not self.blank, 'label': capfirst(self.verbose_name), 'help_text': self.help_text}
766766
defaults.update(kwargs)
767767
return USPhoneNumberField(**defaults)

‎tests/regressiontests/forms/localflavor.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
USZipCodeField validates that the data is either a five-digit U.S. zip code or
88
a zip+4.
9-
>>> from django.contrib.localflavor.usa.forms import USZipCodeField
9+
>>> from django.contrib.localflavor.us.forms import USZipCodeField
1010
>>> f = USZipCodeField()
1111
>>> f.clean('60606')
1212
u'60606'
@@ -67,7 +67,7 @@
6767
6868
USPhoneNumberField validates that the data is a valid U.S. phone number,
6969
including the area code. It's normalized to XXX-XXX-XXXX format.
70-
>>> from django.contrib.localflavor.usa.forms import USPhoneNumberField
70+
>>> from django.contrib.localflavor.us.forms import USPhoneNumberField
7171
>>> f = USPhoneNumberField()
7272
>>> f.clean('312-555-1212')
7373
u'312-555-1212'
@@ -136,7 +136,7 @@
136136
137137
USStateField validates that the data is either an abbreviation or name of a
138138
U.S. state.
139-
>>> from django.contrib.localflavor.usa.forms import USStateField
139+
>>> from django.contrib.localflavor.us.forms import USStateField
140140
>>> f = USStateField()
141141
>>> f.clean('il')
142142
u'IL'
@@ -181,7 +181,7 @@
181181
182182
USStateSelect is a Select widget that uses a list of U.S. states/territories
183183
as its choices.
184-
>>> from django.contrib.localflavor.usa.forms import USStateSelect
184+
>>> from django.contrib.localflavor.us.forms import USStateSelect
185185
>>> w = USStateSelect()
186186
>>> print w.render('state', 'IL')
187187
<select name="state">
@@ -247,7 +247,7 @@
247247
</select>
248248
249249
# USSocialSecurityNumberField #################################################
250-
>>> from django.contrib.localflavor.usa.forms import USSocialSecurityNumberField
250+
>>> from django.contrib.localflavor.us.forms import USSocialSecurityNumberField
251251
>>> f = USSocialSecurityNumberField()
252252
>>> f.clean('987-65-4330')
253253
u'987-65-4330'

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /