[Zope] Problems with list of object references
Sven Rudolph
rudolph@medical-tribune.de
Mon, 12 Aug 2002 12:39:09 +0200
Hello everybody,
I have a problem with a list of object references.
I wrote a product that buffers a list of objects. The list is created with
self.LIST = self.restrictedTraverse(ListOfPaths).objectValues['MyOtherProduct']))
inside a function called "charge_buffer".
This product also has a DTMLFile named "show_list". "show_list" contains:
<dtml-var LIST>
When I open "show_list" in my browser I can see the list like this:
[<MyOtherProduct instance at ecdcfa8>, <MyOtherProduct instance at ecdd050>, etc. ]
(This seems to be a list of addresses)
As a result I can use "LIST" in an in-tag in another DTMLFile called "use_list":
<dtml-in LIST>
<dtml-var id><br>
</dtml-in>
This seems to work very well. When I open "use_list" in my browser I see a list of ids.
But when I reload "use_list" 3 or 4 times I suddenly get an attribute error for "get", just as if the sequence-item wasn't an object anymore.
The same thing happens when I refresh my product or restart the server.
(BTW. my product inherits from Persistant, and I set _p_changed=1 after charging the buffer)
So I repeatedly called "charge_buffer" and looked at "show_list" and "use_list". "use_list" always showed me the same list of id's, as I expectet, but "show_list" always showed me a different list where the adresses where always different.
It seems that the "addresses" of my object instances change a view seconds after loading my buffer. As a result I am unable to save a list of object references for later use.
Can anybody help me with this?
Thanks in advance
Sven Rudolph
--
Sven Rudolph, Programmierer
GermanMedicalServices.de GmbH
Unter den Eichen 5, 65195 Wiesbaden
Tel.: 06 11 / 97 46 25 2