[Zope] stopping indexing of acquired attributes

Chris Withers chrisw@nipltd.com
Mon, 30 Dec 2002 11:46:38 +0000


Luca Olivetti wrote:
> No success because when the method gets called self is an instance of 
> MyClass, so the method never returns None.

I would index the actual attribute, I'd index something called 
index_yourattributename. Then define a method called 'index_yourattributename' 
as follows:

return getattr(context.aq_explicit,'yourattributename')

...and if you're really paranoid, make 'index_yourattributename' an external method:

from Acquisition import aq_base

def index_yourattributename(self):
   return getattr(aq_base(self),'yourattributename')

cheers,

Chris