diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-10-25 12:27:27 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-10-25 12:27:56 +0200 |
| commit | 415ef34c4c2d4e9416ecf04ddf8cfb33585f1934 (patch) | |
| tree | 12194fbcd557df1cd3ea5099307da032ad360812 /docs/ref/forms/fields.txt | |
| parent | 8b18e0bb3ba8bb1f51e15487a6d5402853e637ae (diff) | |
[5.0.x] Added missing pycon directives in various docs.
Backport of 718b32c6918037cfc746d7867333d79a3c887a8c from main
Diffstat (limited to 'docs/ref/forms/fields.txt')
| -rw-r--r-- | docs/ref/forms/fields.txt | 6 |
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).'] |
