Skip to content

Commit fa72e3b

Browse files
committed
docs: issue2550961 - required attribute incorrectly shown when using field()
Document how to use field(required=None) so input has just the bareword required rather than required=X in the tag.
1 parent 95adf57 commit fa72e3b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/reference.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2986,6 +2986,20 @@ There are several methods available on these wrapper objects:
29862986
labelfirst (Boolean properties only)
29872987
place the labels before the radio buttons
29882988

2989+
Other arguments are added as properties directly on the
2990+
input tag. For example::
2991+
2992+
field(size=30, id='myid', required=None)
2993+
2994+
produces::
2995+
2996+
<input id="myid" size="30" required>
2997+
2998+
Note that using ``None`` as the value results in an
2999+
attribute without a value. This is useful for boolean
3000+
properties like ``required``.
3001+
3002+
29893003
rst only on String properties - render the value of the property
29903004
as ReStructuredText (requires the :ref:`Docutils
29913005
module to be installed separately<install/docutils>`).

0 commit comments

Comments
 (0)