locatability of objects inside a list in bluebream
Hello all, I have a following interface definitions class IMyListObject(Interface): name = TextLine( title=u'Name') class IMyObject(Interface): name = TextLine( title=u'Name') ... my_list = List( title=u'My Object list', value_type=Object( title='My List Object', schema=IMyListObject) ) For adding the 'IMyListObject' into the my_list of 'IMyObject' I created a browser page for 'IMyObject' with zope.formlib AddForm's form_fields set to 'IMyListObject' and appended them to the 'my_list' field. That part works great. But I like to know, what is the preferred way of making objects inside the 'my_list' to be locatable. So that I can have an edit page or a display page for the 'IMyListObject' in that list. One approach what I thought was to make 'IMyObject' as a container with all other schema fields in place except the 'my_list' field and add the 'IMyListObject' to the 'IMyObject' as child objects, so that all the 'IMyListObject' objects are locatable. But I really wanted to know if it is possible to make objects inside a list locatable as that would be necessary in the case of creating an object tree of the following format. class INode(Interface): parent = Object( title=u"Parent node", schema=Interface ) children = List( title=u'Child nodes', value_type=Object(schema=Interface) ) INode['parent'].schema = INode INode['children'].value_type.schema = INode Please guide me in this regard. [Sorry for always cross posting to both bluebream and zope-dev mailing lists. Also I find another not so active zope3-users mailing list available. As most of my queries gets answered from zope-dev mailing list I am still in confusion on which mailing list to single out. Kindly bear with me.] Regards -- Joshua Immanuel HiPro IT Solutions Private Limited http://hipro.co.in
Am 25.08.2011 um 09:54 schrieb Joshua Immanuel: [...]
But I like to know, what is the preferred way of making objects inside the 'my_list' to be locatable. So that I can have an edit page or a display page for the 'IMyListObject' in that list.
The list and the objects inside the list both have to implement zope.location.interfaces.ILocation. To traverse to the `my_list` object you might use the ++attribute++ traverser. To traverse from the list to its content objects you might need your own traverser (not sure if it works out of the box). Again an older German blog entry might help: http://blog.gocept.com/benutzung-des-attribute-namespaces-in-zope3 Yours sincerely, -- Michael Howitz · mh@gocept.com · software developer gocept gmbh & co. kg · Forsterstraße 29 · 06112 Halle (Saale) · Germany http://gocept.com · tel +49 345 1229889 8 · fax +49 345 1229889 1 Zope and Plone consulting and development
Hello Michael, Thanks for the reply. On Thu, 2011-08-25 at 10:57 +0200, Michael Howitz wrote:
The list and the objects inside the list both have to implement zope.location.interfaces.ILocation. To traverse to the `my_list` object you might use the ++attribute++ traverser. To traverse from the list to its content objects you might need your own traverser (not sure if it works out of the box).
Again an older German blog entry might help: http://blog.gocept.com/benutzung-des-attribute-namespaces-in-zope3
I'll check and get back. I think I'll have to read all your posts under the category zope3 :) Regards -- Joshua Immanuel HiPro IT Solutions Private Limited http://hipro.co.in
participants (2)
-
Joshua Immanuel -
Michael Howitz