mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #12856 -- Documented BoundField API.
This commit is contained in:
parent
534aaf56f4
commit
2f53d342f1
3 changed files with 171 additions and 81 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue