Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
|
|
|
12 | 12 | from django.conf import settings |
13 | 13 | from django.utils.translation import gettext, gettext_lazy, ngettext |
14 | 14 | from django.utils.functional import Promise, lazy |
| 15 | from django.core import regex |
| 16 | import settings |
15 | 17 | import re |
16 | 18 | |
17 | 19 | _datere = r'\d{4}-\d{1,2}-\d{1,2}' |
… |
… |
|
27 | 29 | r')@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}$', re.IGNORECASE) # domain |
28 | 30 | integer_re = re.compile(r'^-?\d+$') |
29 | 31 | ip4_re = re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$') |
30 | | phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE) |
31 | 32 | slug_re = re.compile(r'^[-\w]+$') |
32 | 33 | url_re = re.compile(r'^https?://\S+$') |
33 | 34 | |
… |
… |
|
184 | 185 | raise ValidationError, gettext("The URL %s does not point to a valid image.") % field_data |
185 | 186 | |
186 | 187 | def isValidPhone(field_data, all_data): |
| 188 | lang = settings.LANGUAGE_CODE.replace('-', '_') |
| 189 | phone_re = getattr(regex, 'phone_%s' % lang, regex.phone_en_us) |
187 | 190 | if not phone_re.search(field_data): |
188 | 191 | raise ValidationError, gettext('Phone numbers must be in XXX-XXX-XXXX format. "%s" is invalid.') % field_data |
189 | 192 | |