Re: [Django] #19078: Polish IBAN field

2013-05-02 Thread Django
#19078: Polish IBAN field
-+--
 Reporter:  bartosak@…   |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Forms|  Version:  1.4
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  polish IBAN  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by benkonrath):

 Hi,

 For anybody who's following this, you don't need a specific country
 validation for IBAN. There's a generic validation algorithm all valid IBAN
 countries which I implemented in this package:

 https://github.com/benkonrath/django-iban

 I hope this is useful for anybody looking to use IBANs in Django.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19078: Polish IBAN field

2012-10-15 Thread Django
#19078: Polish IBAN field
-+--
 Reporter:  bartosak@…   |Owner:  nobody
 Type:  New feature  |   Status:  closed
Component:  Forms|  Version:  1.4
 Severity:  Normal   |   Resolution:  wontfix
 Keywords:  polish IBAN  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by lrekucki):

 * cc: lrekucki (added)
 * status:  new => closed
 * resolution:   => wontfix


Comment:

 Hi,

 Thanks for your contribution, but localflavor packages have been recently
 split into seperate repositiories on Github and their developement will
 continue there.

 Please post this issue on https://github.com/django/django-localflavor-pl.
 Thanks :)

 Either way, for the change to be accepted it needs to come in a form of a
 patch (or a github pull request), needs to contain tests and (in case of
 new features like) documentation.

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19078: Polish IBAN field

2012-10-06 Thread Django
#19078: Polish IBAN field
-+--
 Reporter:  bartosak@…   |Owner:  nobody
 Type:  New feature  |   Status:  new
Component:  Forms|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:  polish IBAN  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by bartosak):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 That was my proposal based on
 https://docs.djangoproject.com/en/dev/ref/contrib/localflavor/ page

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] #19078: Polish IBAN field

2012-10-06 Thread Django
#19078: Polish IBAN field
-+-
 Reporter:  bartosak@…   |  Owner:  nobody
 Type:  New feature  | Status:  new
Component:  Forms|Version:  1.4
 Severity:  Normal   |   Keywords:  polish IBAN
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+-
 I would like to add polish IBAN account number field

 {{{
 from django.core.validators import EMPTY_VALUES
 from django.forms import ValidationError, RegexField
 from django.utils.translation import ugettext_lazy as _

 class PLIBANField(RegexField):
 """
 Polish International Bank Account Number (IBAN) field

 For Polish IBAN validation algorithm see
 http://pl.wikipedia.org/wiki/International_Bank_Account_Number
 """
 default_error_messages = {
 'invalid': _('Enter a valid IBAN in PLXX------
  format'),
 }

 def __init__(self, max_length=40, min_length=28, *args, **kwargs):
 super(PLIBANField, self).__init__(r'^[0-9A-Za-z\-\s]{28,40}$',
 max_length, min_length, *args, **kwargs)

 def clean(self, value):
 """
 Strips - and spaces, performs country code and checksum validation
 """
 value = super(PLIBANField, self).clean(value)
 if value in EMPTY_VALUES:
 return u''
 value = value.replace('-','')
 value = value.replace(' ','')
 value = value.upper()
 if value[0:2] != 'PL':
 raise ValidationError(self.error_messages[_('Unknown country
 code')])
 numeric_format = ''
 for char in value[4:] + value[0:4]:
 if char.isalpha():
 numeric_format += str(ord(char) - 55)
 else:
 numeric_format += char
 if int(numeric_format) % 97 != 1:
 raise ValidationError(self.error_messages[_('Invalid
 checksum')])
 return value
 }}}

-- 
Ticket URL: 
Django 
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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.