Ticket #5192: 5192a.diff

File 5192a.diff, 1007 bytes (added by simeon, 17 years ago)

Alter django.core.validators.py

  • django/core/validators.py

     
    2323_datere = r'\d{4}-\d{1,2}-\d{1,2}'
    2424_timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?'
    2525alnum_re = re.compile(r'^\w+$')
    26 alnumurl_re = re.compile(r'^[-\w/]+$')
     26alnumurl_re = re.compile(r'^[-\w/~]+$')
    2727ansi_date_re = re.compile('^%s$' % _datere)
    2828ansi_time_re = re.compile('^%s$' % _timere)
    2929ansi_datetime_re = re.compile('^%s %s$' % (_datere, _timere))
     
    7373
    7474def isAlphaNumericURL(field_data, all_data):
    7575    if not alnumurl_re.search(field_data):
    76         raise ValidationError, _("This value must contain only letters, numbers, underscores, dashes or slashes.")
     76        raise ValidationError, _("This value must contain only letters, numbers, underscores, dashes, the tilde, or slashes.")
    7777
    7878def isSlug(field_data, all_data):
    7979    if not slug_re.search(field_data):
Back to Top