Opened 15 years ago
Closed 14 years ago
#13729 closed Bug (fixed)
UK localflavor mis-named/documentation bug.
Reported by: | Matthew Schinckel | Owned by: | nobody |
---|---|---|---|
Component: | contrib.localflavor | Version: | 1.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The documentation for localflavor states that:
Inside that package, country- or culture-specific code is organized into subpackages, named using ISO 3166 country codes.
However, the ISO 3166 code for the United Kingdom is actually GB. Thus, anything that uses ISO 3166 codes to store countries (such as django-countries) will be unable to automatically get the correct localflavor information.
Since changing this would break existing code, perhaps there could be another gb module that just shadows the uk module.
For instance, in gb/forms.py, we might have:
from django.contrib.localflavor import uk GBPostcodeField = uk.UKPostcodeField GBCountySelect = uk.UKCountySelect GBNationSelect = uk.UKNationSelect
This means that all is needed is this file, and any changes to the uk one will also apply to gb.
Attachments (2)
Change History (12)
by , 15 years ago
Attachment: | gb-localflavor.diff added |
---|
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
comment:3 by , 14 years ago
Component: | Contrib apps → django.contrib.localflavor |
---|
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:5 by , 14 years ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | set |
We cannot leave the uk directory occupied by the gb content, because uk is the code for Ukrain. So we have to move files and follow a deprecation path in the current uk directory.
comment:6 by , 14 years ago
Has patch: | set |
---|---|
Patch needs improvement: | unset |
by , 14 years ago
Attachment: | 13729-with-deprecation-path.diff added |
---|
comment:7 by , 14 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:8 by , 14 years ago
Just to correct comment 5, UA is the code for Ukraine. UK is "exceptionally reserved" for the United Kingdom (see http://www.iso.org/iso/iso-3166-1_decoding_table#UK).
comment:9 by , 14 years ago
Thanks for the correction, I mixed up uk ISO 639-1 for Ukrainian language and UA the ISO 3166 country code for Ukraine. It is not referenced in the patch, though.
I raised this issue previously in #8323. As this ticket has been accepted and has a proposed patch, I closed the older ticket in favour of this one.