~ubuntu-branches/ubuntu/natty/python-django/natty-updates

« back to all changes in this revision

Viewing changes to django/forms/fields.py

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2009-10-12 19:22:16 UTC
  • mfrom: (1.1.9 upstream) (4.4.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091012192216-l4wb7fp72wow19zp
Tags: 1.1.1-1ubuntu1
* Merge python-django 1.1.1-1 from debian unstable (LP: #447617)
  for security and bug fixes, all Ubuntu changes merged by Debian.
* Add to debian/patches:
  - 20_python2.6.3_regression.patch - backported upstream commit 11620
    to make Django work with Python 2.6.3 properly. (LP: #445639)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from util import ErrorList, ValidationError
31
31
from widgets import TextInput, PasswordInput, HiddenInput, MultipleHiddenInput, FileInput, CheckboxInput, Select, NullBooleanSelect, SelectMultiple, DateInput, DateTimeInput, TimeInput, SplitDateTimeWidget, SplitHiddenDateTimeWidget
32
 
from django.core.files.uploadedfile import SimpleUploadedFile as UploadedFile
33
32
 
34
33
__all__ = (
35
34
    'Field', 'CharField', 'IntegerField',
422
421
email_re = re.compile(
423
422
    r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # dot-atom
424
423
    r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"' # quoted-string
425
 
    r')@(?:[A-Z0-9]+(?:-*[A-Z0-9]+)*\.)+[A-Z]{2,6}$', re.IGNORECASE)  # domain
 
424
    r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?$', re.IGNORECASE)  # domain
426
425
 
427
426
class EmailField(RegexField):
428
427
    default_error_messages = {
533
532
 
534
533
url_re = re.compile(
535
534
    r'^https?://' # http:// or https://
536
 
    r'(?:(?:[A-Z0-9]+(?:-*[A-Z0-9]+)*\.)+[A-Z]{2,6}|' #domain...
 
535
    r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}\.?|' #domain...
537
536
    r'localhost|' #localhost...
538
537
    r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
539
538
    r'(?::\d+)?' # optional port