Opened 16 years ago

Closed 13 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

Description

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 16 years ago.
Patch and tests
ca-form-2.diff (2.7 KB ) - added by Claude Paroz 13 years ago.
Similar patch for current trunk (+unittest)

Download all attachments as: .zip

Change History (9)

by Doug Harris, 16 years ago

Attachment: ca-form.diff added

Patch and tests

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: post-1.0
Triage Stage: UnreviewedAccepted

Feature addition. Moving to post-1.0.

comment:2 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:3 by Julien Phalip, 13 years ago

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 by Luke Plant, 13 years ago

Type: Cleanup/optimizationNew feature

by Claude Paroz, 13 years ago

Attachment: ca-form-2.diff added

Similar patch for current trunk (+unittest)

comment:5 by Claude Paroz, 13 years ago

Patch needs improvement: unset

comment:6 by Preston Timmons, 13 years ago

Triage Stage: AcceptedReady for checkin

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

comment:7 by Jannis Leidel, 13 years ago

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