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

Type ConfigurableMixin

object --+
         |
        ConfigurableMixin

Known Subclasses:
Fragment

A sane IConfigurable implementation for Fragment and Page.
Methods starting with bind_ automatically expose corresponding
method names. bind_* should return an IBinding (PropertyBinding
or MethodBinding), or, as a shortcut for MethodBinding, a list of
twoples like this:

def bind_foo(self, ctx):
    return [('argName', String()), ('anotherArg', Integer())]

def foo(self, argName, anotherArg):
    assert isinstance(argName, str)
    assert isinstance(anotherArg, int)

Method Summary
  getBinding(self, ctx, name)
Massage bind_* methods and attributes into an IBinding.
  getBindingNames(self, ctx)
Expose bind_* methods and attributes on this class.
  getDefault(self, forBinding)
Get a default value for a given binding.
  postForm(self, ctx, bindingName, args)
Accept a form post to the given bindingName.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
Implements __implemented__ = <implementedBy nevow.rend.Configurable...
_implementsTuple __implements__ = (<_MetaConfigurable formless.iformless....
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...

Method Details

getBinding(self, ctx, name)

Massage bind_* methods and attributes into an IBinding. The bind_* method or attribute can either already implement IBinding or be a list of twoples which will be massaged into a MethodBinding as described in the ConfigurableMixin class docstring.

getBindingNames(self, ctx)

Expose bind_* methods and attributes on this class.

getDefault(self, forBinding)

Get a default value for a given binding. If the binding is a Property, get the current value of that property off self. If not, simply return forBinding.default.

postForm(self, ctx, bindingName, args)

Accept a form post to the given bindingName. The post arguments are given in args.

This will invoke the IInputProcessor for the binding with the given name. If it succeeds, the property will be modified or the method will have been called. If it fails, a ValidateError exception will be raised.

Class Variable Details

__implemented__

Type:
Implements
Value:
<implementedBy nevow.rend.ConfigurableMixin>                           

__implements__

Type:
_implementsTuple
Value:
(<_MetaConfigurable formless.iformless.IConfigurable>,)                

__providedBy__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x40939a0c>       

__provides__

Type:
ClassProvides
Value:
<zope.interface.declarations.ClassProvides object at 0x40939a0c>       

Generated by Epydoc 2.1 on Wed May 3 13:51:15 2006 http://epydoc.sf.net