Tom Cameron wrote:
I had this problem recently and I solved it (sort of) this way:
I wrote a method that created a unique id I called CID from the time+userIP+random number and then made that a property of the object each time an instance was created.
Was it automagically called as a zope hotpatch ? I mean, was it a patch to zope simple item or so ? That's what I 'd like to do : give a unique ID to any zope object without having to worry about calling a special method manually. Do you think it is possible to patch zope in a way to have this behavior? How did you built your system? IS it available somewhere ?
Then I wrote some methods to walk the tree and return a dictionary of CID:ID pairs so I could easily translate them back.
Yep, we may need that also.
This then lead to some interesting trouble - if I copy an item do I want this id to be copied or reset to a new value? I am presently trying to modify the copy/paste methods so that it resets the id after a copy. Hope to have that solved soon.
In our case, we absolutelly don't want to loose the item ID, even if it's moved. If needed we could update the dictionary. The goal here is to keep an id wherever goes the object. Thanks in advance for your tips ! Philippe