Icon Header

ToscaWidgets

ToscaWidgets is WSGI framework for building reusable web UI components in python. The system allows a web developer to use a complex widget in their application with ease - the internal complexity of the widget is hidden. This helps rapidly develop compelling web applications. It is in theory compatible with any other WSGI-based web framework (such as Pyramid or TurboGears). There is an extensive library of existing widgets.

ToscaWidgets is split into two major versions...

ToscaWidgets 1 is battle-hardened. It has been used for years in the TurboGears community. You can depend on it.

Stable. Older.

""" The most basic form with ToscaWidgets 1 """

import tw.forms as twf

movie_form = twf.TableForm(
    'movie_form',
    action='save_movie',
    children=[
        twf.HiddenField('id'),
        twf.TextField('title'),
        twf.TextField('year', size=4),
        twf.CalendarDatePicker('release_date'),
        twf.SingleSelectField('genera', options=[
            '', 'Action', 'Comedy', 'Other'
        ]),
        twf.TextArea('description'),
    ]
)