Package nevow :: Module rend :: Class ConfigurableFactory
[show private | hide private]
[frames | no frames]

Class ConfigurableFactory

Known Subclasses:
Page

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.
Method Summary
  configurable_(self, context)
Configurable factory for use when self is a configurable; aka it implements IConfigurable or one or more TypedInterface subclasses.
  configurable_original(self, ctx)
Configurable factory for use when self.original is a configurable; aka it implements IConfigurable or one or more TypedInterface subclasses.
  locateConfigurable(self, context, name)
formless.webform.renderForms calls locateConfigurable on the IConfigurableFactory instance it retrieves from the context.

Class Variable Summary
MetaInterface __implements__ = <MetaInterface formless.iformless.IConf...

Method Details

configurable_(self, context)

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(self): pass
    bar = autocallable(bar)

class Foo(Page):
    __implements__ = IFoo,

    def bar(self):
        print "bar called through the web!"

    def render_forms(self, ctx, data):
        return renderForms() # or renderForms('')

    docFactory = stan(render_forms).

configurable_original(self, ctx)

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)

locateConfigurable(self, context, name)

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 Variable Details

__implements__

Type:
MetaInterface
Value:
<MetaInterface formless.iformless.IConfigurableFactory>                

Generated by Epydoc 2.1 on Mon Jul 25 16:22:13 2005 http://epydoc.sf.net