summaryrefslogtreecommitdiff
path: root/docs/ref/validators.txt
diff options
context:
space:
mode:
authorSi Feng <si.feng@me.com>2013-07-21 17:27:56 -0700
committerTim Graham <timograham@gmail.com>2014-02-10 05:38:43 -0500
commitb102c27ff4d21ea6262e600227530f75337a5df2 (patch)
tree448783436b3dd1bcc27576d9cc1d7e5fbc3477a8 /docs/ref/validators.txt
parent0d98422b1365ae1e75051036936aab31248d5ee1 (diff)
Fixed #20784 -- Added inverse_match parameter to RegexValidator.
Diffstat (limited to 'docs/ref/validators.txt')
-rw-r--r--docs/ref/validators.txt14
1 files changed, 11 insertions, 3 deletions
diff --git a/docs/ref/validators.txt b/docs/ref/validators.txt
index 1b706ab8e3..b3ae3c6d41 100644
--- a/docs/ref/validators.txt
+++ b/docs/ref/validators.txt
@@ -59,20 +59,22 @@ to, or in lieu of custom ``field.clean()`` methods.
``RegexValidator``
------------------
-.. class:: RegexValidator([regex=None, message=None, code=None])
+.. class:: RegexValidator([regex=None, message=None, code=None, inverse_match=None])
:param regex: If not ``None``, overrides :attr:`regex`. Can be a regular
expression string or a pre-compiled regular expression.
:param message: If not ``None``, overrides :attr:`.message`.
:param code: If not ``None``, overrides :attr:`code`.
+ :param inverse_match: If not ``None``, overrides :attr:`inverse_match`.
.. attribute:: regex
The regular expression pattern to search for the provided ``value``,
or a pre-compiled regular expression. Raises a
:exc:`~django.core.exceptions.ValidationError` with :attr:`message`
- and :attr:`code` if no match is found. By default, matches any string
- (including an empty string).
+ and :attr:`code` if :attr:`inverse_match` is ``False`` and a match is
+ found, or if :attr:`inverse_match` is ``True`` and a match is not found.
+ By default, matches any string (including an empty string).
.. attribute:: message
@@ -85,6 +87,12 @@ to, or in lieu of custom ``field.clean()`` methods.
The error code used by :exc:`~django.core.exceptions.ValidationError`
if validation fails. Defaults to ``"invalid"``.
+ .. attribute:: inverse_match
+
+ .. versionadded:: 1.7
+
+ The match mode for :attr:`regex`. Defaults to ``False``.
+
``URLValidator``
----------------
.. class:: URLValidator([schemes=None, regex=None, message=None, code=None])