Widgets provide a mechanism for displaying basic HTML inputs to the user and then cleaning the input and passing it into a report.
All widgets accept the following parameters as keyword arguments. Some widgets may accept or require additional arguments, which will be specified in their documentation.
Produces a checkbox user input widget. The widget’s default value will be evaluated as checked if it’s truthy and unchecked if it’s falsy.
Produces a text input to build into a datepicker widget. It accepts one additional optional argument:
Note that this widget is rendered simply as an HTML text input with a class of 'bl_datepicker'. It is left up to you to throw a JavaScript datepicker widget on top of it with jQuery or whatever.
For this widget, the default argument can be:
Produces an select input widget. This takes one additional optional argument:
For the default argument for this type of widget, you provide an index into the choices list, similar to how you index into a Python list. For example, if you have three select options, you can default to the second option by passing in default=1. If you want the last selection to be default, you can pass in default=-1.
Produces a text input for an autocomplete widget. Unlike most widgets, this does not accept the default argument. It takes the following extra argument:
Note that this widget is rendered simply as an HTML text input with a class of 'bl_autocomplete', and optionally a class of 'bl_multiple'. It is left up to you to throw a JavaScript autocompletion widget on top of it with jQuery or whatever.
The cleaned user input will be coerced to a list of integer IDs.