Part of nevow.rend View Source View In Hierarchy
Known subclasses: nevow.rend.Page
Implements interfaces: formless.iformless.IConfigurableFactory
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 263 | Method | locateConfigurable | formless.webform.renderForms calls locateConfigurable on the IConfigurableFactory |
| 276 | Method | configurable_ | Configurable factory for use when self is a configurable; |
| 302 | Method | configurable_original | Configurable factory for use when self.original is a configurable; |
formless.webform.renderForms calls locateConfigurable on the IConfigurableFactory instance it retrieves from the context. It passes the "name" that was passed to it, so if renderForms() was placed in the DOM, locateConfigurable will be called with name = ''; if renderForms('foo') was placed in the DOM, locateConfigurable will be called with name = 'foo'.
This default implementation of locateConfigurable looks for a configurable_* method corresponding to the name which was passed.
>>> class IFoo(TypedInterface):
... def bar(): pass
... bar = autocallable(bar)
...
>>> class Foo(Page):
... implements(IFoo)
...
... def bar():
... print "bar called through the web!"
...
... def render_forms(self, ctx, data):
... return renderForms() # or renderForms('')
...
... docFactory = stan(render_forms).
>>> class Foo(Page):
... def __init__(self):
... self.original = SomeConfigurable()
... def render_forms(self, ctx, data):
... return renderForms('original')
... docFactory = stan(render_forms)