[Zope-CMF] Re: [CMF-checkins] CVS: CMF/CMFDefault - MembershipTool.py:1.43

Tres Seaver tseaver at zope.com
Tue Feb 10 16:46:33 EST 2004


Casey Duncan wrote:
> On Tue, 10 Feb 2004 22:02:31 +0100
> Florent Guillaume <fg at nuxeo.com> wrote:
> 
> 
>>The use case I have is for special folders (proxy folders) in CPS
>>where the __getitem__ behavior is designed to do other things than
>>direct attribute access (there is a better separation between
>>attribute access and subitem access).
>>
>>You're right about the aq_base, but I'll code it differently:
>>   if hasattr(aq_base(members), id):
>>     folder = getattr(members, id)
>>     ...
> 
> 
> Except that hasattr swallows conflict errors... 8^/
> 
> 
>>Note that getattr is used in getMembersFolder and createMemberArea and
>>
>>not [] so I wanted to homogenize things and at the same time fix my
>>problem.
>>
>>But if you still think it's problematic I'll remove it and
>>monkey-patch it from CPS.
> 
> 
> Nah, it seems ok. Just muddles up the code a bit. I'm ok with it.

Could we just use '_getObject' instead?  It should avoid the dance 
around 'ac_base' and '__of__.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com



More information about the Zope-CMF mailing list