Class n.r.ConfigurableFactory:

Part of nevow.rend View Source View In Hierarchy

Known subclasses: nevow.rend.Page

Implements interfaces: formless.iformless.IConfigurableFactory

Locates configurables by looking for methods that start with configurable_ and end with the name of the configurable. The method should take a single arg (other than self) - the current context.
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;
def locateConfigurable(self, context, name): (source)

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.
def configurable_(self, context): (source)
Configurable factory for use when self is a configurable; aka it implements IConfigurable or one or more TypedInterface subclasses. Usage:
>>> 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).
def configurable_original(self, ctx): (source)
Configurable factory for use when self.original is a configurable; aka it implements IConfigurable or one or more TypedInterface subclasses. Usage:
>>> class Foo(Page):
...     def __init__(self):
...         self.original = SomeConfigurable()
...     def render_forms(self, ctx, data):
...         return renderForms('original')
...     docFactory = stan(render_forms)
API Documentation for Nevow, generated by pydoctor.