[Zope3-Users] Two content objects' simultaneous adding
Jean-Marc Orliaguet
jmo at ita.chalmers.se
Sat May 20 09:21:52 EDT 2006
Jonathan wrote:
>
> ----- Original Message ----- From: "baiju m" <baiju.m.mail at gmail.com>
>> I have two content objects (both are containers) but I cannot add one
>> to another as give here :
>> ...
>
>
> I don't use zope 3 (yet!) but a quick look at the above code seems to
> indicate that this is not a zope 3 issue:...
>> square['Comp1'] = company
> This line treats square as if it were a python dictionary (not an
> object, which it is!)
>
but he wrote that both are containers. zope3 use __setitem__ as a way to
add items to containers, see: zope.app.container.interfaces.
class IWriteContainer(Interface):
"""An interface for the write aspects of a container."""
def __setitem__(name, object):
"""Add the given `object` to the container under the given
name...:"""
/JM
More information about the Zope3-users
mailing list