Widgets

This module includes some helper widgets for common use cases.

Usage:

>>> from web2py_utils import widgets

ULRadioWidget

Creates a radio widget using UL instead of TABLE

ULCheckboxesWidget

Creates a checkboxes widget using UL instead of TABLE

Resizable

Adds the class ‘resizable’ to a text widget. This is for use with the jquery.resizable plugin.

WMD

WMD_Ignore WMD_Preview WMD_Output

Use these classes to assign the appropriate WMD classes to textareas.

Widget

This class creates a widget with your custom _class or other **kwargs.

Usage:

>>> db.dogs.name.widget = widgets.Widget('string', _class='my_custom')

UIWidget

Adds the appropriate jquery.ui themeroller classes to the widget

Usage:

>>> db.dogs.name.widget = widgets.UIWidget('string')

Replace all widgets

Will replace all of SQLFORMs widgets with your custom widget. If ui is true it will use UIWidget.

Usage:

>>> widgets.replace_all(SQLFORM, ui=True, _class="custom_inputs")

Table Of Contents

Previous topic

States and Years

Next topic

Wordpress to Python

This Page