Django

Code

Ticket #9066 (closed: fixed)

Opened 2 years ago

Last modified 1 year ago

Add Czech localflavor package

Reported by: mathwizard Assigned to: Elvard
Milestone: Component: django.contrib.localflavor
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

cs_localflavor.patch (4.9 kB) - added by mathwizard on 09/12/08 15:52:55.
Patch containing initial implementation of Czech localflavor
cz_localflavour.patch (12.8 kB) - added by Elvard on 09/22/08 12:21:18.
Bugs in CZBirthNumberField corrected and appropriate tests provided

Change History

09/12/08 15:52:55 changed by mathwizard

  • attachment cs_localflavor.patch added.

Patch containing initial implementation of Czech localflavor

09/14/08 15:06:34 changed by Elvard

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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 ) 09/16/08 20:41:09 changed by mtredinnick

  • needs_better_patch set to 1.
  • stage changed from Unreviewed to Accepted.
  • needs_tests set to 1.
  • needs_docs set to 1.
  1. 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 use choices=... to include the regions now, so a special model field isn't needed there.
  1. 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.
  1. Neither patch includes tests or documentation.

(in reply to: ↑ 2 ) 09/17/08 02:52:25 changed by Elvard

  • needs_better_patch deleted.
  • needs_tests deleted.
  • needs_docs deleted.

Replying to mtredinnick:

2. 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.

3. 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)

09/17/08 06:20:28 changed by Elvard

I changed name of CZBirthNumberField to CZSocialSecurityNumber (according to localflavor conventions).

09/17/08 08:44:19 changed by Elvard

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)

09/21/08 07:32:33 changed by Elvard

  • stage changed from Accepted to Unreviewed.

Names of Czech regions corrected (according to discussion in django-cs user group)

New method added - CZICNumberField, for validation of IC number.

09/22/08 12:21:18 changed by Elvard

  • attachment cz_localflavour.patch added.

Bugs in CZBirthNumberField corrected and appropriate tests provided

10/06/08 04:29:53 changed by Elvard

  • stage changed from Unreviewed to Ready for checkin.

11/05/08 15:16:49 changed by Elvard

  • owner changed from nobody to Elvard.

12/27/08 15:31:08 changed by Elvard

  • milestone set to post-1.0.

02/22/09 01:51:58 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

(In [9876]) Fixed #9066 -- Added Czech localflavor. Thanks to Elvard for the contribution.

02/22/09 01:57:46 changed by russellm

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.

02/25/09 13:51:44 changed by

  • milestone deleted.

Milestone post-1.0 deleted


Add/Change #9066 (Add Czech localflavor package)




Change Properties
Action