Thierry Florac wrote:
I want to set some references from object to another object through. I try to explain this with example classes.Le vendredi 29 janvier 2010, Vladislav Vorobiev <vav...@mykniga.de> a écrit : ====================================================================== ...Thierry thank you for answer but it doesn't help. I implement all what you sad. I tried with normal “list” and than swiched to “PersistentList” code looks like that: from persistent.list import PersistentList import transaction <snip> myList=PersistentList([self.context.pfad, 'object]) myList = PersistentList([self.context.pfad, 'object]) #hope I anderstud you right ob.refList= myList ob._p_changed = True ob.refList._p_changed = True self.context._setObject(id, ob) After add I call again: ob._p_changed = True ob.refList._p_changed = True transaction.commit() I see the commitet trunsactions in ZMI The same problem. After restart ist the Attribut not in context. For example return's Before restart: ***1 ob.refList.objectValues().absolute_url() /pfad/object/FirstObjectOfReferencedObject After restart only the id of the object: ob.refList.objectValues().absolute_url() FirstObjectOfReferencedObject Here is a place for an other question: Normaly self.absolute_url() returns url with hostname, (http://localhost/bla/bla) but already befor restart I get without http://localhost/... see ***1 It seem's that I forgot something. I would be glad to if somebody explain me this problem.====================================================================== In fact I'm not really sure to understand your data structure and it's goals... Could you explain me what you want to do ?? Thierry
Example with two classes:
Now I set the referece
Now I can access through the attribut to s0 and s1 objects:
This construction works persistent without problems.
The idea is to put the references in a list.
to access them
It works in zope without restart. If the server was restartet I get some unwanted results. See my previews posts.
The same effects I get with PersistentLists...
I hope it is more understandable.
_______________________________________________ Zope maillist - Zope@zope.org https://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope-dev )