[Zope-dev] Patch to fix problem

Chris Withers chrisw@nipltd.com
Tue, 07 Nov 2000 12:09:06 +0000


Chris Withers wrote:
> 
> If I try and add a property in __init__ as so:
> 
> self.manage_addProperty('AProperty','1\n2\n3','lines')
> 
> I get the following wonderful error:
> 
> Error Type: AttributeError
> Error Value: aq_base

I made this go away with a patch to PropertyManager.py:

===================================================================
RCS file: /cvs-repository/Zope2/lib/python/OFS/PropertyManager.py,v
retrieving revision 1.30
diff -r1.30 PropertyManager.py
199c199
<            or hasattr(self.aq_base, id):
---
>            or hasattr(getattr(self,'aq_base',self), id):

I'm sticking this in the collector so please tell me if my patch is
wrong ;-)

cheers,

Chris