Other Module Contents

DeleteButton

class tw.dynforms.widgets.DeleteButton(*args, **kw)
A button to delete a row in a growing form. This is created automatically and would not usually be used directly.

HidingContainerMixin

class tw.dynforms.widgets.HidingContainerMixin
Mixin to add hiding functionality to a container widget. The developer can use multiple inheritence to combine this class with a container widget, e.g. ListFieldSet. For this to work correctly, the container must make use of the container_attrs parameter on child widgets.

HidingLoopError

class tw.dynforms.widgets.HidingLoopError(msg=None)

HidingMissingError

class tw.dynforms.widgets.HidingMissingError(msg=None)

IntNull

class tw.dynforms.widgets.IntNull(*args, **kw)

Validator that parses a string to an integer, or returns None for the empty string.

Messages

badType:
The input must be a string (not a %(type)s: %(value)r)
empty:
Please enter a value
integer:
Please enter an integer value
noneType:
The input must be a string (not None)
tooHigh:
Please enter a number that is %(max)s or smaller
tooLow:
Please enter a number that is %(min)s or greater

load_options

tw.dynforms.widgets.load_options(datasrc, code=None, extra=[, ('', '')])
Load data from an SQLAlchemy object into list of (code, value) pairs, suitable for use with SingleSelectField and other widgets.

SearchError

class tw.dynforms.widgets.SearchError
This can be raised by a search callback function to indicate an error occured. It is caught by ajax_helper and translated to an error indicator in the JSON response, causing the error to be displayed on the client.

strip_wo_markers

tw.dynforms.widgets.strip_wo_markers(val)
Remove WriteOnlyMarker instances from a dict/list structure. Where the marker is a value in a dictionary, the corresponding key is removed. Note: this is done separately from the validator, as an implementation details in TurboGears means a validator cannot reliably remove a key from a dictionary. This may be removed in future, if a workaround is found.

StripDictValidator

class tw.dynforms.widgets.StripDictValidator(strip, *args, **kw)

Validator that takes a dict containing another value, and strips off the outer dict.

Messages

badDictType:
The input must be dict-like (not a %(type)s: %(value)r)
badType:
The input must be a string (not a %(type)s: %(value)r)
empty:
Please enter a value
missingValue:
Missing value
noneType:
The input must be a string (not None)
notExpected:
The input field %(name)s was not expected.