Class f.a.Choice(Typed):

Part of formless.annotate View Source View In Hierarchy

Known subclasses: formless.annotate.Radio

Allow the user to pick from a list of "choices", presented in a drop-down menu. The elements of the list will be rendered by calling the function passed to stringify, which is by default "str".

Split Table into Classes Show Methods in One Table

Line # Kind Name Docs
280 Method __init__ Create a Choice.
329 Method coerce Coerce a value with the help of an object, which is the object

Inherited from Typed:

Line # Kind Name Docs
137 Method getAttribute Undocumented
Line # Kind Name Docs
280 Method __init__ Create a Choice.
329 Method coerce Coerce a value with the help of an object, which is the object
137 Method getAttribute Undocumented
def __init__(self, *args, choices=None, choicesAttribute=None, stringify=str, valueToKey=str, keyToValue=None, keyAndConfigurableToValue=None, **kw): (source)
Create a Choice.
Parameterschoicesan object adaptable to IGettable for an iterator (such as a function which takes (ctx, data) and returns a list, a list itself, a tuple, a generator...)
stringifya pretty-printer. a function which takes an object in the list of choices and returns a label for it.
valueToKeya function which converts an object in the list of choices to a string that can be sent to a client.
keyToValuea 1-argument convenience version of keyAndConfigurableToValue
keyAndConfigurableToValuea 2-argument function which takes a string such as one returned from valueToKey and a configurable, and returns an object such as one from the list of choices.
def coerce(self, val, configurable): (source)
Coerce a value with the help of an object, which is the object we are configuring.
API Documentation for Nevow, generated by pydoctor.