From 18b3a9dd395278232354a4f2507660a4f849c6eb Mon Sep 17 00:00:00 2001 From: antoliny0919 Date: Wed, 6 Nov 2024 18:47:54 +0900 Subject: [PATCH] Fixed #35889 -- Corrected reference of default widgets in "Styling widget instance" docs. --- docs/ref/forms/widgets.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index dd2ba0ac4c5..38647aa1c2c 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -142,9 +142,9 @@ For example, take the following form:: url = forms.URLField() comment = forms.CharField() -This form will include three default :class:`TextInput` widgets, with default -rendering -- no CSS class, no extra attributes. This means that the input boxes -provided for each widget will be rendered exactly the same: +This form will include :class:`TextInput` widgets for the name and comment +fields, and a :class:`URLInput` widget for the url field. Each has default +rendering - no CSS class, no extra attributes: .. code-block:: pycon @@ -154,11 +154,11 @@ provided for each widget will be rendered exactly the same:
Url:
Comment:
-On a real web page, you probably don't want every widget to look the same. You -might want a larger input element for the comment, and you might want the -'name' widget to have some special CSS class. It is also possible to specify -the 'type' attribute to take advantage of the new HTML5 input types. To do -this, you use the :attr:`Widget.attrs` argument when creating the widget:: +On a real web page, you probably want to customize this. You might want a +larger input element for the comment, and you might want the 'name' widget to +have some special CSS class. It is also possible to specify the 'type' +attribute to use a different HTML5 input type. To do this, you use the +:attr:`Widget.attrs` argument when creating the widget:: class CommentForm(forms.Form): name = forms.CharField(widget=forms.TextInput(attrs={"class": "special"}))