Part of formless.iformless View Source View In Hierarchy
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 116 | Method | setDefault | Sets the 'key' parameter to the default 'value' |
| 120 | Method | getDefault | Gets the default value from the parameter 'key' |
| 124 | Method | getAllDefaults | Gets the defaults dict for the 'key' autocallable |
| 141 | Method | clearAll | Clears all the default values |
>>> class IMyForm(annotate.TypedInterface):
... def doSomething(name=annotate.String()):
... pass
... doSomething = annotate.autocallable(doSomething)
>>> class Page(rend.Page):
... implements(IMyForm)
... docFactory = loaders.stan(t.html[t.head[t.title['foo']],t.body[render_forms]])
...
... def render_forms(self, ctx, data):
... defaults_dict = iformless.IFormDefaults(ctx).getAllDefaults('doSomething')
... defaults_dict['name'] = 'fooo'
... return webform.renderForms()