Opened 14 years ago

Closed 14 years ago

#14937 closed (fixed)

US localflavor postal abbreviations

Reported by: James Bennett Owned by: nobody
Component: contrib.localflavor Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

Building on #9022 and the ongoing fallout from #8425, we really should provide a way to represent all abbreviations recognized by the US Postal Service without causing an international incident.

The attached patch does this by breaking down the choices into multiple fine-grained lists. It is backwards compatible in that its version of STATE_CHOICES contains all the choices present in the current STATE_CHOICES, but adds the following:

  • STATE_CHOICES now also contains Armed Forces "state" abbreviations.
  • A new tuple, USPS_CHOICES, contains all recognized USPS abbreviations, including independent nations which receive postal service from the United States.
  • A new model field (USPostalCodeField) and form field (USPSSelect) are added, taking advantage of the new USPS_CHOICES tuple.
  • Individual choice tuples are provided for: the "lower 48" states plus DC; all 50 states plus DC; all US territories; all US armed forces "states"; independent nations serviced by USPS; and obsolete abbreviations formerly recognized by USPS (e.g., the Panama Canal Zone).

Attachments (2)

us_postal_codes.diff (15.3 KB ) - added by James Bennett 14 years ago.
us_postal_codes_2.diff (15.3 KB ) - added by James Bennett 14 years ago.
Correct a typo in original patch

Download all attachments as: .zip

Change History (3)

by James Bennett, 14 years ago

Attachment: us_postal_codes.diff added

by James Bennett, 14 years ago

Attachment: us_postal_codes_2.diff added

Correct a typo in original patch

comment:1 by James Bennett, 14 years ago

Resolution: fixed
Status: newclosed

(In [15029]) Refactor the choices for localflavor's USStateField, and add new US postal code support. Fixes #14937 and #9022, refs #10308 and #8425.

Note: See TracTickets for help on using tickets.
Back to Top