----- Original Message ----- From: "baiju m" <[EMAIL PROTECTED]>
I have two content objects (both are containers) but I cannot add one
to another as give here :

   def create(self, data):
       square = Square()
       square.name = data['name']
       square.description = data['description']
       company = Company()
       company.name = data['companyname']
       company.description = data['companydescription']
       square['Comp1'] = company
       ...
       return square


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 = Square()
This line assigns an object to 'square'

       square.name = data['name']
This line treats square properly

       square['Comp1'] = company
This line treats square as if it were a python dictionary (not an object, which it is!)

I think you need Square() to create a dictionary item within the object it returns and then access the list item by:
       square.compList['Comp1'] = company


Just a guess...


Jonathan


_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to