Ticket #13341: 13341-regexvalidator.diff
File 13341-regexvalidator.diff, 1.2 KB (added by , 15 years ago) |
---|
-
docs/ref/validators.txt
59 59 ``RegexValidator`` 60 60 ------------------ 61 61 62 .. class:: RegexValidator(regex =None, message=None, code=None)62 .. class:: RegexValidator(regex, message=None, code=None) 63 63 64 .. attribute:: regex =None64 .. attribute:: regex 65 65 66 The regular expression to search for the provided ``value``. Raises a67 ``ValidationError`` if no match was found.66 The regular expression pattern to search for the provided ``value``. Raises a 67 ``ValidationError`` with ``message`` and ``code`` if no match is found. 68 68 69 .. attribute:: code='invalid'69 .. attribute:: message=None 70 70 71 The error code to use if validation fails. Defaults to ``'invalid'``. 71 The error message used by ``ValidationError`` if validation fails. If no 72 ``message`` is specified, a generic ``"Enter a valid value"`` message is used. 72 73 73 .. attribute:: message=None74 .. attribute:: code=None 74 75 75 The error message to use if ``regex`` doesn't match the provided ``value``. 76 The error code used by ``ValidationError`` if validation fails. If ``code`` 77 is not specified, ``"invalid"`` is used. 76 78 77 79 ``URLValidator`` 78 80 ----------------