class formbar.config.Config(tree)[source]

Class for accessing the form configuration file. It provides methods to get certain elements from the configuration.

get_form(id)[source]

Returns a Form instance with the configuration for a form with id in the configuration file. If the form can not be found a KeyError is raised.

Id:ID of the form in the configuration file
Returns:FormConfig instance
class formbar.config.Form(tree, parent)[source]

Class for accessing the configuration of a specific form. The form configuration only provides a subset of available attributes for forms.

class formbar.form.Form(config, item=None, dbsession=None, translate=None, change_page_callback={}, renderers={}, request=None, csrf_token=None, eval_url=None)[source]

Class for forms. The form will take care for rendering the form, validating the submitted data and saving the data back to the item.

The form must be instanciated with an instance of an Form configuration and optional an SQLAlchemy mapped item.

If an SQLAlchemy mapped item is provided there are some basic validation is done based on the defintion in the database. Further the save method will save the values directly into the database.

If no item was provided than a dummy item will be created with the attributes of the configured fields in the form.

formbar.config.load(path)[source]

Return the parsed XML form the given file. The function will load the file located in path and than returns the parsed content.

This Page