[z3-five] Adapted component instantiation?

Petri Savolainen petri.savolainen at iki.fi
Fri Dec 17 14:54:19 MET 2004


When adapting a zope2 component using some zope3/Five adapters, how does 
one construct them? Do I need to override the __new__ method? Ie. 
something like:

class SimpleAtContent(BaseContent):

    meta_type = portal_type ="SimpleContent"

    def __new__(cls, *args, **kwargs):
       obj = BaseContent(*args, **kwargs)
       adapted = IMyInterface(obj)
       return adapted

Thanks,

    Petri



More information about the z3-five mailing list