[Zope-CMF] Re: RE: [Zope-dev] Performance problem in ZOPE 2.5.1, 'getOwner' in /lib/python/AccessControl/Owned.py

Max M maxm@mxm.dk
Mon, 09 Sep 2002 11:07:33 +0200


Arnar Lundesgaard wrote:

>>I *guess* it is code that is testing the truth value of the user


>>Does adding this method fix the problem too:
>>
>>    def __nonzero__(self):
>>        return 1


If you tried to get the first object in the userfolder:

def __nonzero__(self):
     try:
         x = self[0] # you probably cannot do it just like that ...
         result = 1
     except:
         result = 0
     return result


at least it would act correctly if the userfolder is empty  :-s


regards Max M

 ><evolve>
   >    >