From 232b60a21b951bd16b8c95b34fcbcbf3ecd89fca Mon Sep 17 00:00:00 2001 From: David Smith Date: Sun, 12 Feb 2023 13:20:05 +0000 Subject: Refs #32339 -- Updated docs to reflect default
style form rendering in Django 5.0. Follow up to 98756c685ee173bbd43f21ed0553f808be835ce5. --- docs/ref/forms/widgets.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'docs/ref/forms/widgets.txt') diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 45b154f753..43a579b4a5 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -144,10 +144,10 @@ provided for each widget will be rendered exactly the same: .. code-block:: pycon >>> f = CommentForm(auto_id=False) - >>> f.as_table() - Name: - Url: - Comment: + >>> print(f) +
Name:
+
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 @@ -182,10 +182,10 @@ you can use the :attr:`Form.fields` attribute:: Django will then include the extra attributes in the rendered output: >>> f = CommentForm(auto_id=False) - >>> f.as_table() - Name: - Url: - Comment: + >>> print(f) +
Name:
+
Url:
+
Comment:
You can also set the HTML ``id`` using :attr:`~Widget.attrs`. See :attr:`BoundField.id_for_label` for an example. -- cgit v1.3