Fixed #13341 -- Clarified the arguments to RegexValidators. Thanks to DrMeers for the report, and David Fischer for the draft text.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13148 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2010-05-09 04:26:09 +00:00
parent 3341f39f41
commit 2f279ec595
1 changed files with 11 additions and 8 deletions

View File

@ -63,16 +63,19 @@ methods.
.. attribute:: regex=None .. attribute:: regex=None
The regular expression to search for the provided ``value``. Raises a The regular expression pattern to search for the provided ``value``. Raises a
``ValidationError`` if no match was found. ``ValidationError`` with ``message`` and ``code`` if no match is found. If
no regex is specified, an empty string is used.
.. attribute:: code='invalid'
The error code to use if validation fails. Defaults to ``'invalid'``.
.. attribute:: message=None .. attribute:: message=None
The error message to use if ``regex`` doesn't match the provided ``value``. The error message used by ``ValidationError`` if validation fails. If no
``message`` is specified, a generic ``"Enter a valid value"`` message is used.
.. attribute:: code=None
The error code used by ``ValidationError`` if validation fails. If ``code``
is not specified, ``"invalid"`` is used.
``URLValidator`` ``URLValidator``
---------------- ----------------