Opened 16 years ago
Closed 14 years ago
#9022 closed (fixed)
Allow US armed forces state codes for USStateField
Reported by: | Owned by: | dougvanhorn | |
---|---|---|---|
Component: | contrib.localflavor | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | dougvanhorn@… | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'm not a Yank so I don't know how useful this is to you chaps over the pond. The official list of state codes supported by the US Postal Service was linked on thedailywtf.com and I checked to discover Django does not handle all of the codes:
http://www.usps.com/ncsc/lookups/abbreviations.html#states
Obviously this list runs contrary to #8425 but I thought this deserved a ticket in case you are discriminating against your boys in the Middle East, you UN-AMERICAN, COMMUNIST, CHEESE-EATING... er, wait. I think I'm getting my imported redneck epithets mixed up.
Attachments (2)
Change History (11)
comment:1 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 16 years ago
Has patch: | set |
---|
comment:3 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
Based on Adrian's comment on #10308, marking wontfix.
comment:4 by , 16 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
I'm reopening this ticket because I don't think Adrian's reasoning is sound, based on the fact that there are non-US states in the us_states.py module, such as:
- American Somoa
- Guam
- Northern Mariana Islands
- Puerto Rico
- Virgin Islands
I would also point to the USStateField documentation:
class USStateField(Field): """ A form field that validates its input is a U.S. state name or abbreviation. It normalizes the input to the standard two-leter postal service abbreviation for the given state. """
Which, rather plainly, states that the intent of the field is to represent two-letter postal service abbreviations.
If we're to believe us_states.py should only represent the 50 states with a star on the flag, we need to patch the us_states.py module to remove the US territories listed above.
comment:5 by , 16 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
As documented in the contributing docs, do not reopen tickets marked wontfix by a core committer. If you have something new to add, bring it up on the django-developers mailing list.
comment:6 by , 16 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Triage Stage: | Accepted → Design decision needed |
I actually did bring it up.
Back to DDN.
comment:7 by , 15 years ago
I'm adding a patch to this ticket that will add a USPSStateField to the US localflavor package.
The USPostalCodeField will provide a model field and form fields which will validate USPS Postal Codes per http://www.usps.com/ncsc/lookups/abbreviations.html.
The patch includes regression test updated for forms and serializers_regress (though I'm unsure of what the serializers_regress tests are testing).
./runtests.py passes with 914 tests.
I'm not sure this is the right design choice, but since there seems to be disagreement as to what constitutes a US State, I figured I'd add a field specifically for US Postal Codes.
I'm not sure what this would mean to the USStateField, which, right now, is neither US States nor Postal Codes.
comment:8 by , 15 years ago
Cc: | added |
---|
Definitely a bug. I'll attach a patch.