summaryrefslogtreecommitdiff
path: root/docs/ref/forms/fields.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref/forms/fields.txt')
-rw-r--r--docs/ref/forms/fields.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt
index 5e42404f94..8371a32dfd 100644
--- a/docs/ref/forms/fields.txt
+++ b/docs/ref/forms/fields.txt
@@ -1187,11 +1187,13 @@ Slightly complex built-in ``Field`` classes
The list of fields that should be used to validate the field's value (in
the order in which they are provided).
+ .. code-block:: pycon
+
>>> from django.forms import ComboField
>>> f = ComboField(fields=[CharField(max_length=20), EmailField()])
- >>> f.clean('test@example.com')
+ >>> f.clean("test@example.com")
'test@example.com'
- >>> f.clean('longemailaddress@example.com')
+ >>> f.clean("longemailaddress@example.com")
Traceback (most recent call last):
...
ValidationError: ['Ensure this value has at most 20 characters (it has 28).']