Fixed #12856 -- Documented BoundField API.

This commit is contained in:
Moritz Sichert 2015-08-10 13:23:24 +02:00 committed by Tim Graham
parent 534aaf56f4
commit 2f53d342f1
3 changed files with 171 additions and 81 deletions

View file

@ -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