Author: mtredinnick
Date: 2007-05-16 18:10:31 -0500 (Wed, 16 May 2007)
New Revision: 5271

Modified:
   django/branches/unicode/django/contrib/localflavor/au/forms.py
   django/branches/unicode/django/contrib/localflavor/br/forms.py
   django/branches/unicode/django/contrib/localflavor/cl/forms.py
   django/branches/unicode/django/contrib/localflavor/de/forms.py
   django/branches/unicode/django/contrib/localflavor/fi/forms.py
   django/branches/unicode/django/contrib/localflavor/fr/forms.py
   django/branches/unicode/django/contrib/localflavor/is_/forms.py
   django/branches/unicode/django/contrib/localflavor/it/forms.py
   django/branches/unicode/django/contrib/localflavor/it/it_province.py
   django/branches/unicode/django/contrib/localflavor/it/util.py
   django/branches/unicode/django/contrib/localflavor/jp/forms.py
   django/branches/unicode/django/contrib/localflavor/no/forms.py
   django/branches/unicode/django/contrib/localflavor/no/no_municipalities.py
   django/branches/unicode/django/contrib/localflavor/us/forms.py
Log:
unicode: Unicode audit pass through localflavor. Also fixed a few common
stylistic errors.


Modified: django/branches/unicode/django/contrib/localflavor/au/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/au/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/au/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -15,15 +15,15 @@
     def __init__(self, *args, **kwargs):
         super(AUPostCodeField, self).__init__(r'^\d{4}$',
             max_length=None, min_length=None,
-            error_message=ugettext(u'Enter a 4 digit post code.'),
-            *args, **kwargs)
+            error_message=ugettext('Enter a 4 digit post code.'),
+                    *args, **kwargs)
 
 class AUPhoneNumberField(Field):
     """Australian phone number field."""
     def clean(self, value):
-        """Validate a phone number. Strips parentheses, whitespace and
-        hyphens.
         """
+        Validate a phone number. Strips parentheses, whitespace and hyphens.
+        """
         super(AUPhoneNumberField, self).clean(value)
         if value in EMPTY_VALUES:
             return u''
@@ -39,5 +39,5 @@
     choices.
     """
     def __init__(self, attrs=None):
-        from au_states import STATE_CHOICES # relative import
+        from au_states import STATE_CHOICES
         super(AUStateSelect, self).__init__(attrs, choices=STATE_CHOICES)

Modified: django/branches/unicode/django/contrib/localflavor/br/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/br/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/br/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -16,7 +16,7 @@
         super(BRZipCodeField, self).__init__(r'^\d{5}-\d{3}$',
             max_length=None, min_length=None,
             error_message=ugettext('Enter a zip code in the format 
XXXXX-XXX.'),
-            *args, **kwargs)
+                    *args, **kwargs)
 
 class BRPhoneNumberField(Field):
     def clean(self, value):
@@ -27,7 +27,7 @@
         m = phone_digits_re.search(value)
         if m:
             return u'%s-%s-%s' % (m.group(1), m.group(2), m.group(3))
-        raise ValidationError(ugettext(u'Phone numbers must be in XX-XXXX-XXXX 
format.'))
+        raise ValidationError(ugettext('Phone numbers must be in XX-XXXX-XXXX 
format.'))
 
 class BRStateSelect(Select):
     """
@@ -35,7 +35,7 @@
     as its choices.
     """
     def __init__(self, attrs=None):
-        from br_states import STATE_CHOICES # relative import
+        from br_states import STATE_CHOICES
         super(BRStateSelect, self).__init__(attrs, choices=STATE_CHOICES)
 
 

Modified: django/branches/unicode/django/contrib/localflavor/cl/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/cl/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/cl/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -5,6 +5,7 @@
 from django.newforms import ValidationError
 from django.newforms.fields import RegexField, EMPTY_VALUES
 from django.utils.translation import ugettext
+from django.utils.encoding import smart_unicode
 
 class CLRutField(RegexField):
     """
@@ -19,11 +20,11 @@
             del kwargs['strict']
             super(CLRutField, 
self).__init__(r'^(\d{1,2}\.)?\d{3}\.\d{3}-[\dkK]$',
                 error_message=ugettext('Enter valid a Chilean RUT. The format 
is XX.XXX.XXX-X.'),
-                *args, **kwargs)
+                        *args, **kwargs)
         else:
             # In non-strict mode, accept RUTs that validate but do not exist in
             # the real world.
-            super(CLRutField, self).__init__(r'^[\d\.]{1,11}-?[\dkK]$', 
error_message=ugettext(u'Enter valid a Chilean RUT'), *args, **kwargs)
+            super(CLRutField, self).__init__(r'^[\d\.]{1,11}-?[\dkK]$', 
error_message=ugettext('Enter valid a Chilean RUT'), *args, **kwargs)
 
     def clean(self, value):
         """
@@ -49,14 +50,14 @@
             multi += 1
             if multi == 8:
                 multi = 2
-        return '0123456789K0'[11 - suma % 11]
+        return u'0123456789K0'[11 - suma % 11]
 
     def _canonify(self, rut):
         """
         Turns the RUT into one normalized format. Returns a (rut, verifier)
         tuple.
         """
-        rut = str(rut).replace(' ', '').replace('.', '').replace('-', '')
+        rut = smart_unicode(rut).replace(' ', '').replace('.', 
'').replace('-', '')
         return rut[:-1], rut[-1]
 
     def _format(self, code, verifier=None):
@@ -74,5 +75,5 @@
             else:
                 new_dot = pos - 3
             code = code[:new_dot] + '.' + code[new_dot:]
-        return '%s-%s' % (code, verifier)
+        return u'%s-%s' % (code, verifier)
 

Modified: django/branches/unicode/django/contrib/localflavor/de/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/de/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/de/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -13,15 +13,15 @@
     def __init__(self, *args, **kwargs):
         super(DEZipCodeField, self).__init__(r'^\d{5}$',
             max_length=None, min_length=None,
-            error_message=ugettext(u'Enter a zip code in the format XXXXX.'),
-            *args, **kwargs)
+            error_message=ugettext('Enter a zip code in the format XXXXX.'),
+                    *args, **kwargs)
 
 class DEStateSelect(Select):
     """
     A Select widget that uses a list of DE states as its choices.
     """
     def __init__(self, attrs=None):
-        from de_states import STATE_CHOICES # relative import
+        from de_states import STATE_CHOICES
         super(DEStateSelect, self).__init__(attrs, choices=STATE_CHOICES)
 
 class DEIdentityCardNumberField(Field):
@@ -57,7 +57,7 @@
 
     def clean(self, value):
         super(DEIdentityCardNumberField, self).clean(value)
-        error_msg = ugettext(u'Enter a valid German identity card number in 
XXXXXXXXXXX-XXXXXXX-XXXXXXX-X format.')
+        error_msg = ugettext('Enter a valid German identity card number in 
XXXXXXXXXXX-XXXXXXX-XXXXXXX-X format.')
         if value in EMPTY_VALUES:
             return u''
         match = re.match(id_re, value)
@@ -71,7 +71,7 @@
         if residence == '0000000000' or birthday == '0000000' or validity == 
'0000000':
             raise ValidationError(error_msg)
 
-        all_digits = "%s%s%s%s" % (residence, birthday, validity, checksum)
+        all_digits = u"%s%s%s%s" % (residence, birthday, validity, checksum)
         if not self.has_valid_checksum(residence) or not 
self.has_valid_checksum(birthday) or \
             not self.has_valid_checksum(validity) or not 
self.has_valid_checksum(all_digits):
                 raise ValidationError(error_msg)

Modified: django/branches/unicode/django/contrib/localflavor/fi/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/fi/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/fi/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -11,15 +11,15 @@
     def __init__(self, *args, **kwargs):
         super(FIZipCodeField, self).__init__(r'^\d{5}$',
             max_length=None, min_length=None,
-            error_message=ugettext(u'Enter a zip code in the format XXXXX.'),
-            *args, **kwargs)
+            error_message=ugettext('Enter a zip code in the format XXXXX.'),
+                    *args, **kwargs)
 
 class FIMunicipalitySelect(Select):
     """
     A Select widget that uses a list of Finnish municipalities as its choices.
     """
     def __init__(self, attrs=None):
-        from fi_municipalities import MUNICIPALITY_CHOICES # relative import
+        from fi_municipalities import MUNICIPALITY_CHOICES
         super(FIMunicipalitySelect, self).__init__(attrs, 
choices=MUNICIPALITY_CHOICES)
 
 class FISocialSecurityNumber(Field):
@@ -37,9 +37,9 @@
             (?P<serial>(\d{3}))
             (?P<checksum>[%s])$""" % checkmarks, value, re.VERBOSE | 
re.IGNORECASE)
         if not result:
-            raise ValidationError(ugettext(u'Enter a valid Finnish social 
security number.'))
+            raise ValidationError(ugettext('Enter a valid Finnish social 
security number.'))
         gd = result.groupdict()
         checksum = int(gd['date'] + gd['serial'])
         if checkmarks[checksum % len(checkmarks)] == gd['checksum'].upper():
             return u'%s' % value.upper()
-        raise ValidationError(ugettext(u'Enter a valid Finnish social security 
number.'))
+        raise ValidationError(ugettext('Enter a valid Finnish social security 
number.'))

Modified: django/branches/unicode/django/contrib/localflavor/fr/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/fr/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/fr/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -14,8 +14,8 @@
     def __init__(self, *args, **kwargs):
         super(FRZipCodeField, self).__init__(r'^\d{5}$',
             max_length=None, min_length=None,
-            error_message=ugettext(u'Enter a zip code in the format XXXXX.'),
-            *args, **kwargs)
+            error_message=ugettext('Enter a zip code in the format XXXXX.'),
+                    *args, **kwargs)
 
 class FRPhoneNumberField(Field):
     """
@@ -39,6 +39,6 @@
     A Select widget that uses a list of FR departments as its choices.
     """
     def __init__(self, attrs=None):
-        from fr_department import DEPARTMENT_ASCII_CHOICES # relative import
+        from fr_department import DEPARTMENT_ASCII_CHOICES
         super(FRDepartmentSelect, self).__init__(attrs, 
choices=DEPARTMENT_ASCII_CHOICES)
 

Modified: django/branches/unicode/django/contrib/localflavor/is_/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/is_/forms.py     
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/is_/forms.py     
2007-05-16 23:10:31 UTC (rev 5271)
@@ -6,6 +6,7 @@
 from django.newforms.fields import RegexField, EMPTY_VALUES
 from django.newforms.widgets import Select
 from django.utils.translation import ugettext
+from django.utils.encoding import smart_unicode
 
 class ISIdNumberField(RegexField):
     """
@@ -13,7 +14,7 @@
     of Iceland has.
     """
     def __init__(self, *args, **kwargs):
-        error_msg = ugettext(u'Enter a valid Icelandic identification number. 
The format is XXXXXX-XXXX.')
+        error_msg = ugettext('Enter a valid Icelandic identification number. 
The format is XXXXXX-XXXX.')
         kwargs['min_length'],kwargs['max_length'] = 10,11
         super(ISIdNumberField, self).__init__(r'^\d{6}(-| )?\d{4}$', 
error_message=error_msg, *args, **kwargs)
 
@@ -48,7 +49,7 @@
         Takes in the value in canonical form and returns it in the common
         display format.
         """
-        return value[:6]+'-'+value[6:]
+        return smart_unicode(value[:6]+'-'+value[6:])
 
 class ISPhoneNumberField(RegexField):
     """

Modified: django/branches/unicode/django/contrib/localflavor/it/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/it/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/it/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -13,15 +13,15 @@
     def __init__(self, *args, **kwargs):
         super(ITZipCodeField, self).__init__(r'^\d{5}$',
         max_length=None, min_length=None,
-        error_message=ugettext(u'Enter a valid zip code.'),
-        *args, **kwargs)
+        error_message=ugettext('Enter a valid zip code.'),
+                *args, **kwargs)
 
 class ITRegionSelect(Select):
     """
     A Select widget that uses a list of IT regions as its choices.
     """
     def __init__(self, attrs=None):
-        from it_region import REGION_CHOICES # relative import
+        from it_region import REGION_CHOICES
         super(ITRegionSelect, self).__init__(attrs, choices=REGION_CHOICES)
 
 class ITProvinceSelect(Select):
@@ -29,7 +29,7 @@
     A Select widget that uses a list of IT regions as its choices.
     """
     def __init__(self, attrs=None):
-        from it_province import PROVINCE_CHOICES # relative import
+        from it_province import PROVINCE_CHOICES
         super(ITProvinceSelect, self).__init__(attrs, choices=PROVINCE_CHOICES)
 
 class ITSocialSecurityNumberField(RegexField):

Modified: django/branches/unicode/django/contrib/localflavor/it/it_province.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/it/it_province.py        
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/it/it_province.py        
2007-05-16 23:10:31 UTC (rev 5271)
@@ -33,7 +33,7 @@
     ('KR', 'Crotone'),
     ('CN', 'Cuneo'),
     ('EN', 'Enna'),
-#    ('FM', 'Fermo'), # active starting from 2009    
+#    ('FM', 'Fermo'), # active starting from 2009
     ('FE', 'Ferrara'),
     ('FI', 'Firenze'),
     ('FG', 'Foggia'),

Modified: django/branches/unicode/django/contrib/localflavor/it/util.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/it/util.py       
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/it/util.py       
2007-05-16 23:10:31 UTC (rev 5271)
@@ -1,23 +1,27 @@
+from django.utils.encoding import smart_str, smart_unicode
+
 def ssn_check_digit(value):
     "Calculate Italian social security number check digit."
     ssn_even_chars = {
-        '0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 
8, '9': 9,
-        'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 
8, 'J': 9,
-        'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16, 'R': 
17, 'S': 18,
-        'T': 19, 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24, 'Z': 25
+        '0': 0, '1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8,
+        '9': 9, 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7,
+        'I': 8, 'J': 9, 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15,
+        'Q': 16, 'R': 17, 'S': 18, 'T': 19, 'U': 20, 'V': 21, 'W': 22, 'X': 23,
+        'Y': 24, 'Z': 25
     }
     ssn_odd_chars = {
-        '0': 1, '1': 0, '2': 5, '3': 7, '4': 9, '5': 13, '6': 15, '7': 17, 
'8': 19, '9': 21,
-        'A': 1, 'B': 0, 'C': 5, 'D': 7, 'E': 9, 'F': 13, 'G': 15, 'H': 17, 
'I': 19, 'J': 21,
-        'K': 2, 'L': 4, 'M': 18, 'N': 20, 'O': 11, 'P': 3, 'Q': 6, 'R': 8, 
'S': 12,
-        'T': 14, 'U': 16, 'V': 10, 'W': 22, 'X': 25, 'Y': 24, 'Z': 23
+        '0': 1, '1': 0, '2': 5, '3': 7, '4': 9, '5': 13, '6': 15, '7': 17, '8':
+        19, '9': 21, 'A': 1, 'B': 0, 'C': 5, 'D': 7, 'E': 9, 'F': 13, 'G': 15,
+        'H': 17, 'I': 19, 'J': 21, 'K': 2, 'L': 4, 'M': 18, 'N': 20, 'O': 11,
+        'P': 3, 'Q': 6, 'R': 8, 'S': 12, 'T': 14, 'U': 16, 'V': 10, 'W': 22,
+        'X': 25, 'Y': 24, 'Z': 23
     }
     # Chars from 'A' to 'Z'
     ssn_check_digits = [chr(x) for x in range(65, 91)]
 
     ssn = value.upper()
     total = 0
-    for i in range(0,15):
+    for i in range(0, 15):
         try:
             if i % 2 == 0:
                 total += ssn_odd_chars[ssn[i]]
@@ -30,11 +34,11 @@
 
 def vat_number_check_digit(vat_number):
     "Calculate Italian VAT number check digit."
-    normalized_vat_number = str(vat_number).zfill(10)
+    normalized_vat_number = smart_str(vat_number).zfill(10)
     total = 0
     for i in range(0, 10, 2):
         total += int(normalized_vat_number[i])
     for i in range(1, 11, 2):
         quotient , remainder = divmod(int(normalized_vat_number[i]) * 2, 10)
         total += quotient + remainder
-    return str((10 - total % 10) % 10)
+    return smart_unicode((10 - total % 10) % 10)

Modified: django/branches/unicode/django/contrib/localflavor/jp/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/jp/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/jp/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -18,8 +18,8 @@
     def __init__(self, *args, **kwargs):
         super(JPPostalCodeField, self).__init__(r'^\d{3}-\d{4}$|^\d{7}$',
             max_length=None, min_length=None,
-            error_message=ugettext(u'Enter a postal code in the format XXXXXXX 
or XXX-XXXX.'),
-            *args, **kwargs)
+            error_message=ugettext('Enter a postal code in the format XXXXXXX 
or XXX-XXXX.'),
+                    *args, **kwargs)
 
     def clean(self, value):
         """

Modified: django/branches/unicode/django/contrib/localflavor/no/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/no/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/no/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -12,8 +12,8 @@
     def __init__(self, *args, **kwargs):
         super(NOZipCodeField, self).__init__(r'^\d{4}$',
             max_length=None, min_length=None,
-            error_message=ugettext(u'Enter a zip code in the format XXXX.'),
-            *args, **kwargs)
+            error_message=ugettext('Enter a zip code in the format XXXX.'),
+                    *args, **kwargs)
 
 class NOMunicipalitySelect(Select):
     """
@@ -60,7 +60,7 @@
             self.gender = 'F'
         else:
             self.gender = 'M'
-        
+
         digits = map(int, list(value))
         weight_1 = [3, 7, 6, 1, 8, 9, 4, 5, 2, 1, 0]
         weight_2 = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2, 1]
@@ -74,4 +74,4 @@
             raise ValidationError(msg)
 
         return value
-    
+

Modified: 
django/branches/unicode/django/contrib/localflavor/no/no_municipalities.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/no/no_municipalities.py  
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/no/no_municipalities.py  
2007-05-16 23:10:31 UTC (rev 5271)
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 """
 An alphabetical list of Norwegian municipalities (fylker) fro use as `choices`
 in a formfield.
@@ -15,18 +15,18 @@
     ('hedmark', u'Hedmark'),
     ('hordaland', u'Hordaland'),
     ('janmayen', u'Jan Mayen'),
-    ('moreogromsdal', u'M�re og Romsdal'),
-    ('nordtrondelag', u'Nord-Tr�ndelag'),
+    ('moreogromsdal', u'Møre og Romsdal'),
+    ('nordtrondelag', u'Nord-Trøndelag'),
     ('nordland', u'Nordland'),
     ('oppland', u'Oppland'),
     ('oslo', u'Oslo'),
     ('rogaland', u'Rogaland'),
     ('sognogfjordane', u'Sogn og Fjordane'),
     ('svalbard', u'Svalbard'),
-    ('sortrondelag', u'S�r-Tr�ndelag'),
+    ('sortrondelag', u'Sør-Trøndelag'),
     ('telemark', u'Telemark'),
     ('troms', u'Troms'),
     ('vestagder', u'Vest-Agder'),
     ('vestfold', u'Vestfold'),
-    ('ostfold', u'�stfold')
+    ('ostfold', u'Østfold')
 )

Modified: django/branches/unicode/django/contrib/localflavor/us/forms.py
===================================================================
--- django/branches/unicode/django/contrib/localflavor/us/forms.py      
2007-05-16 22:41:35 UTC (rev 5270)
+++ django/branches/unicode/django/contrib/localflavor/us/forms.py      
2007-05-16 23:10:31 UTC (rev 5271)
@@ -15,8 +15,8 @@
     def __init__(self, *args, **kwargs):
         super(USZipCodeField, self).__init__(r'^\d{5}(?:-\d{4})?$',
             max_length=None, min_length=None,
-            error_message=ugettext(u'Enter a zip code in the format XXXXX or 
XXXXX-XXXX.'),
-            *args, **kwargs)
+            error_message=ugettext('Enter a zip code in the format XXXXX or 
XXXXX-XXXX.'),
+                    *args, **kwargs)
 
 class USPhoneNumberField(Field):
     def clean(self, value):
@@ -38,17 +38,17 @@
         * Conforms to the XXX-XX-XXXX format.
         * No group consists entirely of zeroes.
         * The leading group is not "666" (block "666" will never be allocated).
-        * The number is not in the promotional block 987-65-4320 through 
987-65-4329,
-          which are permanently invalid.
+        * The number is not in the promotional block 987-65-4320 through
+          987-65-4329, which are permanently invalid.
         * The number is not one known to be invalid due to otherwise widespread
-          promotional use or distribution (e.g., the Woolworth's number or the 
1962
-          promotional number).
+          promotional use or distribution (e.g., the Woolworth's number or the
+          1962 promotional number).
     """
     def clean(self, value):
         super(USSocialSecurityNumberField, self).clean(value)
         if value in EMPTY_VALUES:
             return u''
-        msg = ugettext(u'Enter a valid U.S. Social Security number in 
XXX-XX-XXXX format.')
+        msg = ugettext('Enter a valid U.S. Social Security number in 
XXX-XX-XXXX format.')
         match = re.match(ssn_re, value)
         if not match:
             raise ValidationError(msg)
@@ -75,7 +75,7 @@
     abbreviation for the given state.
     """
     def clean(self, value):
-        from us_states import STATES_NORMALIZED # relative import
+        from us_states import STATES_NORMALIZED
         super(USStateField, self).clean(value)
         if value in EMPTY_VALUES:
             return u''
@@ -95,5 +95,5 @@
     A Select widget that uses a list of U.S. states/territories as its choices.
     """
     def __init__(self, attrs=None):
-        from us_states import STATE_CHOICES # relative import
+        from us_states import STATE_CHOICES
         super(USStateSelect, self).__init__(attrs, choices=STATE_CHOICES)


--~--~---------~--~----~------------~-------~--~----~
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