Kaydet (Commit) 2f53d342 authored tarafından Moritz Sichert's avatar Moritz Sichert Kaydeden (comit) Tim Graham

Fixed #12856 -- Documented BoundField API.

üst 534aaf56
This diff is collapsed.
......@@ -230,6 +230,16 @@ foundation for custom widgets.
In older versions, this attribute was only defined on the date
and time widgets (as ``False``).
.. method:: id_for_label(self, id_)
Returns the HTML ID attribute of this widget for use by a ``<label>``,
given the ID of the field. Returns ``None`` if an ID isn't available.
This hook is necessary because some widgets have multiple HTML
elements and, thus, multiple IDs. In that case, this method should
return an ID value that corresponds to the first ID in the widget's
tags.
.. method:: render(name, value, attrs=None)
Returns HTML for the widget, as a Unicode string. This method must be
......
......@@ -690,6 +690,11 @@ Useful attributes on ``{{ field }}`` include:
:class:`~django.forms.Field` attributes, e.g.
``{{ char_field.field.max_length }}``.
.. seealso::
For a complete list of attributes and methods, see
:class:`~django.forms.BoundField`.
Looping over hidden and visible fields
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment