Ticket #721: alnumurl.diff
File alnumurl.diff, 1.0 KB (added by , 19 years ago) |
---|
-
django/core/validators.py
13 13 _datere = r'\d{4}-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[12][0-9])|(?:3[0-1]))' 14 14 _timere = r'(?:[01]?[0-9]|2[0-3]):[0-5][0-9](?::[0-5][0-9])?' 15 15 alnum_re = re.compile(r'^\w+$') 16 alnumurl_re = re.compile(r'^[ \w/]+$')16 alnumurl_re = re.compile(r'^[-\w/]+$') 17 17 ansi_date_re = re.compile('^%s$' % _datere) 18 18 ansi_time_re = re.compile('^%s$' % _timere) 19 19 ansi_datetime_re = re.compile('^%s %s$' % (_datere, _timere)) … … 58 58 59 59 def isAlphaNumericURL(field_data, all_data): 60 60 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." 62 62 63 63 def isSlug(field_data, all_data): 64 64 if not slug_re.search(field_data):