diff options
| author | Tim Graham <timograham@gmail.com> | 2013-06-06 14:15:26 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-06-09 12:16:56 -0400 |
| commit | 3bd9852401cfbc8a1dfec4082303a5514ee69bf4 (patch) | |
| tree | 46c1d89ad20cfe113562c2f10ed68255610678cb /docs/ref/forms/widgets.txt | |
| parent | 44a0abd7928b7f81a9b0e272b1dddd92f1913e0d (diff) | |
[1.5.x] Fixed #20567 - Documented BoundField.id_for_label.
Thanks littlepig for the suggestion.
Backport of 175a102ddc from master.
Diffstat (limited to 'docs/ref/forms/widgets.txt')
| -rw-r--r-- | docs/ref/forms/widgets.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index 98383b89dd..ac16b3c02a 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -163,6 +163,9 @@ Django will then include the extra attributes in the rendered output: <tr><th>Url:</th><td><input type="text" name="url"/></td></tr> <tr><th>Comment:</th><td><input type="text" name="comment" size="40"/></td></tr> +You can also set the HTML ``id`` using :attr:`~Widget.attrs`. See +:attr:`BoundField.id_for_label` for an example. + .. _styling-widget-classes: Styling widget classes @@ -249,6 +252,8 @@ foundation for custom widgets. :class:`~datetime.datetime` value into a list with date and time split into two separate values:: + from django.forms import MultiWidget + class SplitDateTimeWidget(MultiWidget): # ... |
