Ticket #721: alnumurl.diff

File alnumurl.diff, 1.0 KB (added by Esaj, 19 years ago)
  • django/core/validators.py

     
    1313_datere = r'\d{4}-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[12][0-9])|(?:3[0-1]))'
    1414_timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?'
    1515alnum_re = re.compile(r'^\w+$')
    16 alnumurl_re = re.compile(r'^[\w/]+$')
     16alnumurl_re = re.compile(r'^[-\w/]+$')
    1717ansi_date_re = re.compile('^%s$' % _datere)
    1818ansi_time_re = re.compile('^%s$' % _timere)
    1919ansi_datetime_re = re.compile('^%s %s$' % (_datere, _timere))
     
    5858
    5959def isAlphaNumericURL(field_data, all_data):
    6060    if not alnumurl_re.search(field_data):
    61         raise ValidationError, "This value must contain only letters, numbers, underscores or slashes."
     61        raise ValidationError, "This value must contain only letters, numbers, underscores, dashes or slashes."
    6262
    6363def isSlug(field_data, all_data):
    6464    if not slug_re.search(field_data):
Back to Top