[Zope] UserInfoFolder - bug!

Danny William Adair Danny@Adair.net
Thu, 5 Apr 2001 15:35:19 +1200


Ok, I plucked up courage and tried what I thought would help, and it did.

>>> UserInfoFolder.py:
>>> ---------------------------------------------------------------------
>>> class UserInfoFolder(ObjectManager,PropertyManager,Item,RoleManager):
>>>
>>>     [...]
>>>
>>>     def _getOb(self, id, default=''):
>>>         if not hasattr(self, id):
>>>             product=self.manage_addProduct[self.productName]
>>>             zclass=eval('product.'+self.className)
>>>             obj=apply(zclass,[])
>>>             obj._setId(id)
>>>             self._setObject(id,obj,set_owner=0)
>>>             return obj
>>>         return getattr(self, id)
>>>
>>>     [...]
>>> ---------------------------------------------------------------------

if you change
>>>         if not hasattr(self, id):

to
>>>         if not hasattr(self.aq_explicit, id):

everything works as "expected". At second thought... in some other
environment I might have just killed a feature! Maybe put some flag "aquired
stuff counts" here to have both?

Danny