[Zope] Getting REQUEST in product method by default

Brian Lloyd brian@zope.com
Fri, 1 Feb 2002 11:06:02 -0500


> This works great!  Thanks!  But I see that there is something 
> else wrong with my plan.  When I try to call 
> MyClass.getData(self, ...), I get an error essentially saying 
> that my ZMyClass instance is not an instance of MyClass, so I 
> can't call that method.  Python's isinstance tells me that this 
> is the case even though issubclass verifies that ZMyClass is a 
> subclass of MyClass.  Is it not possible to wrap regular  Python 
> classes with Zope wrappers simply by inheriting from the regular 
> class and a Zope class like Folder/SimpleItem?

Ahh... this is probably due to the fact that one is an 
ExtensionClass and one is a normal class. Try doing:

ZMyClass.inheritedAttribute('getData')()


Brian Lloyd        brian@zope.com
Software Engineer  540.361.1716       
Zope Corporation   http://www.zope.com