Skip to content

Commit

Permalink
Merge pull request #726 from nattster/fix/doc
Browse files Browse the repository at this point in the history
Update documentation on Custom widgets
  • Loading branch information
azmeuk committed Jan 8, 2022
2 parents 0c7aee2 + 0091b4e commit efe4e90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/widgets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ class. For example, here is a widget that renders a
if checked:
options['checked'] = 'checked'
html.append('<li><input %s /> ' % html_params(**options))
html.append('<label for="%s">%s</label></li>' % (field_id, label))
html.append('<label for="%s">%s</label></li>' % (choice_id, label))
html.append('</ul>')
return ''.join(html)

class TestForm(Form):
tester = SelectMultipleField(choices=my_choices, widget=select_multi_checkbox)

0 comments on commit efe4e90

Please sign in to comment.