#9066 closed (fixed)
Add Czech localflavor package
Reported by: | mathwizard | Owned by: | Tomáš Ehrlich |
---|---|---|---|
Component: | contrib.localflavor | Version: | dev |
Severity: | 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
I am attaching a patch containing some form ields for Czech localflavor:
Mainly: CSZipCodeField, CSRegionSelect, CSPhoneNumberField, CSBirthNumberField
Some of them also have model fields added.
Attachments (2)
Change History (14)
by , 16 years ago
Attachment: | cs_localflavor.patch added |
---|
comment:1 by , 16 years ago
Commiting another version of Czech flavor (without models).
Changes:
- Country code is CZ according to ISO 3166
- Regions Králové-Hradecký and Moravsko-Slezský are written without dash (-)
- Altered regexp in CZBirthNumberField - slash is optional
- Removed models and CZPhoneNumberField class
- Why we need phone number in fromat XXX-XXX-XXX?
- Why we need models at all in this case? I've looked into several language directories in localflavor directory and I havan't any model files.
follow-up: 3 comment:2 by , 16 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
- Not worth including model fields at the moment. They are really just normal character fields with choices and validation. So when model-aware validation is included, it will be better to just include some validators for these things that people can add to the
CharField
. They can already usechoices=...
to include the regions now, so a special model field isn't needed there.
- Our policy is to use the common English names (where such things exist) for any regions, states, etc and then mark them for translation. Then the Czech locale can use the local translated versions if they choose. It looks like there are English names for those regions (for example, wikipedia has a list) so we should be consistent there. I realise the Czech versions are used inside the Czech republic, but things from localflavor are used and read by a broader audience than that.
- Neither patch includes tests or documentation.
comment:3 by , 16 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
Patch needs improvement: | unset |
Replying to mtredinnick:
- Our policy is to use the common English names (where such things exist) for any regions, states, etc and then mark them for translation. Then the Czech locale can use the local translated versions if they choose. It looks like there are English names for those regions (for example, wikipedia has a list) so we should be consistent there. I realise the Czech versions are used inside the Czech republic, but things from localflavor are used and read by a broader audience than that.
I entirely rewrite cz_regions.py using English names. Source is mentioned in module comment, but I'm not sure about all of those names. Please someone to check it.
- Neither patch includes tests or documentation.
Sorry, I don't know about that. Tests are included, documentation also (Hope I wrote documentation at the right place)
comment:4 by , 16 years ago
I changed name of CZBirthNumberField to CZSocialSecurityNumber (according to localflavor conventions).
comment:5 by , 16 years ago
I made final corrections in cz_localflavor.patch (I hope).
Tests are running (Finally I know, how tests works) and Czech local flavor passed all tests.
CZSocialSecurityNumber renamed back to CZBirthNumber according to wiki (http://en.wikipedia.org/wiki/National_identification_number#Czech_Republic)
This method is improved also:
- It tests the 'modulo of 11' property of Czech Birth number.
- If optional parametr Gender is specified, it tests the month part of birth number (1 <= mm <= 12, after corrections - month of females is raised by 50)
- Tests the day part of birth number (1 <= dd <= 31)
comment:6 by , 16 years ago
Triage Stage: | Accepted → Unreviewed |
---|
Names of Czech regions corrected (according to discussion in django-cs user group)
New method added - CZICNumberField, for validation of IC number.
by , 16 years ago
Attachment: | cz_localflavour.patch added |
---|
Bugs in CZBirthNumberField corrected and appropriate tests provided
comment:7 by , 16 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
comment:8 by , 16 years ago
Owner: | changed from | to
---|
comment:9 by , 16 years ago
milestone: | → post-1.0 |
---|
comment:10 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:11 by , 16 years ago
Elvard - If you drop me an email with your full name and email address, I'll put you in the CONTRIB file. Also, we would be most appreciative if you could complete a contributor's license agreement.
Patch containing initial implementation of Czech localflavor