Render forms for either the named configurable, or, if no
configurableKey is given, the main configurable. If no bindingNames are
given, forms will be rendered for all bindings described by the
configurable.
| Parameters | configurableKey | The name of the configurable to render. The empty string indicates
ctx.locate(IRenderer).
|
| bindingNames | The names of the bindings to render. None indicates all bindings.
|
| bindingDefaults | A dict mapping bindingName: bindingDefault. For example, given the
TypedInterface:
>>> class IMyForm(annotate.TypedInterface):
... def doSomething(self, name=annotate.String()):
... pass
... doSomething = annotate.autocallable(doSomething)
... def doNothing(self name=annotate.String()):
... pass
... doNothing = annotate.autocallable(doNothing)
... def doMoreThings(self name=annotate.String(), things=annotate.String()):
... pass
... doMoreThings = annotate.autocallable(doMoreThings)
One might call renderForms() like this::
return webform.renderForms(
'',
bindingDefaults={'doSomething': {'name': 'jimbo'},
# Change 'name' default, don't change 'things'
'doMoreThings': {'things': 'jimbo'}
})
This would cause a form to be rendered which will call doSomething when
submitted, and would have "jimbo" filled out as the default value for
the name field, as well as a form which will call doMoreThings (with no
default value filled in for 'name' but 'jimbo' filled in for 'things').
|