Widget Reference
================

This is a reference document with a list of the provided widgets and their
arguments.


.. _link-widget:

``LinkWidget``
~~~~~~~~~~~~~~

This widget renders each option as a link, instead of an actual <input>.  It has
one method that you can override for additional customizability.
``option_string()`` should return a string with 3 Python keyword argument
placeholders:

1. ``attrs``: This is a string with all the attributes that will be on the
   final ``<a>`` tag.
2. ``query_string``: This is the query string for use in the ``href``
   option on the ``<a>`` element.
3. ``label``: This is the text to be displayed to the user.


.. _boolean-widget:

``BooleanWidget``
~~~~~~~~~~~~~~~~~

This widget converts its input into Python's True/False values. It will convert
all case variations of ``True`` and ``False`` into the internal Python values.
To use it, pass this into the ``widgets`` argument of the ``BooleanFilter``::

  active = BooleanFilter(widget=BooleanWidget())


.. _csv-widget:

``CSVWidget``
~~~~~~~~~~~~~

This widget expects a comma separated value and converts it into a list of
string values. It is expected that the field class handle a list of values as
well as type conversion.
