From 415ef34c4c2d4e9416ecf04ddf8cfb33585f1934 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Wed, 25 Oct 2023 12:27:27 +0200 Subject: [5.0.x] Added missing pycon directives in various docs. Backport of 718b32c6918037cfc746d7867333d79a3c887a8c from main --- docs/ref/forms/fields.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/ref/forms/fields.txt') 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).'] -- cgit v1.3