summaryrefslogtreecommitdiff
path: root/docs/ref/validators.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref/validators.txt')
-rw-r--r--docs/ref/validators.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/ref/validators.txt b/docs/ref/validators.txt
index 6f10b44284..9bbcf9bcbc 100644
--- a/docs/ref/validators.txt
+++ b/docs/ref/validators.txt
@@ -281,3 +281,19 @@ to, or in lieu of custom ``field.clean()`` methods.
.. versionchanged:: 1.8
The ``message`` parameter was added.
+
+``DecimalValidator``
+--------------------
+
+.. class:: DecimalValidator(max_digits, decimal_places)
+
+ .. versionadded:: 1.9
+
+ Raises :exc:`~django.core.exceptions.ValidationError` with the following
+ codes:
+
+ - ``'max_digits'`` if the number of digits is larger than ``max_digits``.
+ - ``'max_decimal_places'`` if the number of decimals is larger than
+ ``decimal_places``.
+ - ``'max_whole_digits'`` if the number of whole digits is larger than
+ the difference between ``max_digits`` and ``decimal_places``.