[Zope3-Users] Disappearing dictionary. Upon restart, dictionary
resets.
Dominik Huber
dominik.huber at perse.ch
Wed Sep 21 04:41:27 EDT 2005
Alec Munro wrote:
>I have a content component that has a property that is a dictionary,
>the keys of which are objects (content components themselves). The
>values are lists of strings. I've tried implementing this a couple
>different ways, but each time I restart, the dictionary comes up
>empty.
>I've tried initializing the dictionary as a standard dictionary, a
>peristent dictionary, and as a field property. The results are the
>same in any case.
>Is there a problem with using objects as dictionary keys in this circumstance?
>
>What I am trying to do is provide additional information relevant to
>an object (the keys) specific to a given location (the original
>content component). If there is another simple way to do this, I would
>appreciate hearing it.
>
IMO, regularly immutable objects are used as keys. -> reason for
intid-utility.
You could use the inids (zope.app.intid utility) to associate those objects.
(The zope.app.observable package could be another interesting approach
for instance specific subscriptions.)
Regards,
Dominik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dominik.huber.vcf
Type: text/x-vcard
Size: 154 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20050921/c163f549/dominik.huber.vcf
More information about the Zope3-users
mailing list