#10756: Correct PLNIPField
------------------------------------+-------------------------------------
               Reporter:  remik     |          Owner:  nobody
                   Type:  Bug       |         Status:  new
              Milestone:            |      Component:  contrib.localflavor
                Version:  SVN       |       Severity:  Normal
             Resolution:            |       Keywords:
           Triage Stage:  Accepted  |      Has patch:  1
    Needs documentation:  0         |    Needs tests:  0
Patch needs improvement:  0         |  Easy pickings:  0
------------------------------------+-------------------------------------
Changes (by michalm):

 * cc: michal.modzelewski@... (added)
 * has_patch:  0 => 1
 * version:  1.0 => SVN
 * easy:   => 0


Comment:

 I've added a patch to fix this.
 New accepted formats are XXX-XXX-XX-XX, XXX-XX-XX-XXX and XXXXXXXXXX based
 on http://pl.wikipedia.org/wiki/NIP, the historical wikipedia entry
 http://pl.wikipedia.org/w/index.php?title=NIP&oldid=18661745 and some
 polish legal forums that discussed the matter of validation.
 Some translations from the wikipedia article:

     Prefiks - trzy pierwsze cyfry każdego NIP oznaczają kod urzędu
 skarbowego, który nadał dany numer.

     Prefix - the first three digits in each NIP signify the tax office
 that assigned the number.



     W przeszłości NIP zwyczajowo zapisywało się, oddzielając grupy cyfr
 łącznikiem. Obecnie nadawany jest bez znaków łącznika.

     In the past a NIP was commonly writen with dashes separating the digit
 groups. Currently numbers are assigned without dashes.

 Translated excerpt from the historical artical:

     Zwyczajowo NIP zapisuje się, oddzielając grupy cyfr łącznikiem. Dla
 osób fizycznych numer dzielony jest na grupy 123-456-78-90, a dla osób
 prawnych, bądź ułomnych osób prawnych, na grupy 123-45-67-890.

     Commonly a NIP is written with dashes separating the digits into
 groups.  For individuals the number is split into groups 123-456-78-90,
 and for legal personalities and restricted legal personalities into groups
 123-45-67-890.


 From the note on prefixes we can see that the previous accepted format of
 XX-XX-XXX-XXX was incorrect so I have removed it.
 Apropos the comment by zgoda, since the current accepted format is without
 dashes, we only need to accept the current format and the two historical
 formats posted in the bug report by remik, and in the historical wikipedia
 entry.

 We don't need to support the previously accepted format for backwards
 compatibility since the fields clean method stripped the dashes.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/10756#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to