Opened 8 years ago

Closed 5 years ago

#8527 closed New feature (fixed)

CAPostalCodeField made more forgiving of input format

Reported by: dharris Owned by: nobody
Component: contrib.localflavor Version: master
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:


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 dharris 8 years ago.
Patch and tests
ca-form-2.diff (2.7 KB) - added by claudep 5 years ago.
Similar patch for current trunk (+unittest)

Download all attachments as: .zip

Change History (9)

Changed 8 years ago by dharris

Patch and tests

comment:1 Changed 8 years ago by mtredinnick

  • milestone set to post-1.0
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Feature addition. Moving to post-1.0.

comment:2 Changed 8 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:3 Changed 5 years ago by julien

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

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

comment:4 Changed 5 years ago by lukeplant

  • Type changed from Cleanup/optimization to New feature

Changed 5 years ago by claudep

Similar patch for current trunk (+unittest)

comment:5 Changed 5 years ago by claudep

  • Patch needs improvement unset

comment:6 Changed 5 years ago by prestontimmons

  • Triage Stage changed from Accepted to Ready for checkin

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

comment:7 Changed 5 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

In [16175]:

(The changeset message doesn't reference this ticket)

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