summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorCurtis <curtis@tinbrain.net>2015-02-05 23:26:15 +1100
committerTim Graham <timograham@gmail.com>2015-07-01 17:47:05 -0400
commit11cac1bd8ef7546ca32d9969d4348bf412dc6664 (patch)
tree4a83b9056acdf88c601e73a3b3b02876fe022eca /docs/ref
parentb535eb3fcb6768b2ee2a900c3ca7217b5aecffa6 (diff)
Fixed #4960 -- Added "strip" option to CharField
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/forms/fields.txt20
1 files changed, 17 insertions, 3 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index dbade5c5d9..c4a40021d0 100644
--- a/docs/ref/forms/fields.txt
+++ b/docs/ref/forms/fields.txt
@@ -361,7 +361,7 @@ For each field, we describe the default widget used if you don't specify
Otherwise, all inputs are valid.
* Error message keys: ``required``, ``max_length``, ``min_length``
- Has two optional arguments for validation:
+ Has three optional arguments for validation:
.. attribute:: max_length
.. attribute:: min_length
@@ -369,6 +369,13 @@ For each field, we describe the default widget used if you don't specify
If provided, these arguments ensure that the string is at most or at least
the given length.
+ .. attribute:: strip
+
+ .. versionadded:: 1.9
+
+ If ``True`` (default), the value will be stripped of leading and
+ trailing whitespace.
+
``ChoiceField``
~~~~~~~~~~~~~~~
@@ -824,8 +831,15 @@ For each field, we describe the default widget used if you don't specify
A regular expression specified either as a string or a compiled regular
expression object.
- Also takes ``max_length`` and ``min_length``, which work just as they do for
- ``CharField``.
+ Also takes ``max_length``, ``min_length``, and ``strip``, which work just
+ as they do for ``CharField``.
+
+ .. attribute:: strip
+
+ .. versionadded:: 1.9
+
+ Defaults to ``False``. If enabled, stripping will be applied before the
+ regex validation.
.. deprecated:: 1.8