Opened 14 years ago

Closed 11 years ago

#8527 closed New feature (fixed)

CAPostalCodeField made more forgiving of input format

Reported by: Doug Harris Owned by: nobody
Component: contrib.localflavor Version: dev
Severity: Normal Keywords: ca postal code
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


Similar to the work done in [6952] for #5670 for UKPostcodeField, this change is more forgiving of Canadian postal code input. Uppercase, lowercase, with or without a space in between the two segments.

The clean method returns a nice, clean version -- enter 'K1A 0A9', 'k1a 0A9', 'k1a0a9', or even ' k1A 0A9 ' and it will return the standard form: 'K1A 0A9'.

Patch contains code change and additions to regression tests.

Attachments (2)

ca-form.diff (2.7 KB) - added by Doug Harris 14 years ago.
Patch and tests
ca-form-2.diff (2.7 KB) - added by Claude Paroz 11 years ago.
Similar patch for current trunk (+unittest)

Download all attachments as: .zip

Change History (9)

Changed 14 years ago by Doug Harris

Attachment: ca-form.diff added

Patch and tests

comment:1 Changed 14 years ago by Malcolm Tredinnick

milestone: post-1.0
Triage Stage: UnreviewedAccepted

Feature addition. Moving to post-1.0.

comment:2 Changed 13 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:3 Changed 11 years ago by Julien Phalip

Easy pickings: set
Patch needs improvement: set
Severity: Normal
Type: Cleanup/optimization

The tests would need to be rewritten using unittests since this is now Django's preferred way.

comment:4 Changed 11 years ago by Luke Plant

Type: Cleanup/optimizationNew feature

Changed 11 years ago by Claude Paroz

Attachment: ca-form-2.diff added

Similar patch for current trunk (+unittest)

comment:5 Changed 11 years ago by Claude Paroz

Patch needs improvement: unset

comment:6 Changed 11 years ago by Preston Timmons

Triage Stage: AcceptedReady for checkin

I reviewed this patch. It looks good and applies cleanly to revision 16169.

comment:7 Changed 11 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

In [16175]:

(The changeset message doesn't reference this ticket)

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