Class f.i.IFormDefaults(Interface):

Part of formless.iformless View Source View In Hierarchy

Default values for the current form
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
def setDefault(key, value, context=None): (source)
Sets the 'key' parameter to the default 'value'
def getDefault(key, context=None): (source)
Gets the default value from the parameter 'key'
def getAllDefaults(key): (source)
Gets the defaults dict for the 'key' autocallable
>>> 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()
def clearAll(): (source)
Clears all the default values
API Documentation for Nevow, generated by pydoctor.