Building a cache on an object
I'd like to construct an associative cache of information, which would basically be a dictionary. My first thought was to create a property that was a dictionary, and store values in the dictionary. Unfortunately, none of the allowable property types corresponds to a dictionary. Can I add a dictionary directly to an object such as a folder or DTML method? -- A.M. Kuchling http://starship.python.net/crew/amk/ The world is a tragedy to those who feel, but a comedy to those who think. -- Horace Walpole
On Thu, 29 Jul 1999, A.M. Kuchling wrote:
I'd like to construct an associative cache of information, which would basically be a dictionary. My first thought was to create a property that was a dictionary, and store values in the dictionary. Unfortunately, none of the allowable property types corresponds to a dictionary. Can I add a dictionary directly to an object such as a folder or DTML method?
No, but you can subclass an object via zclasses and construct a custom property interface ;) Look for my forth-coming "policy suggestions" post on zope-dev
-- A.M. Kuchling http://starship.python.net/crew/amk/ The world is a tragedy to those who feel, but a comedy to those who think. -- Horace Walpole
Cheers, Anthony Pfrunder Zope Community Development Partner
On Thu, 29 Jul 1999, A.M. Kuchling wrote:
I'd like to construct an associative cache of information, which would basically be a dictionary. My first thought was to create a property that was a dictionary, and store values in the dictionary. Unfortunately, none of the allowable property types corresponds to a dictionary. Can I add a dictionary directly to an object such as a folder or DTML method? Well, at least to a token property, which is a list, you can add anything ;)
<dtml-call "manage_changeProperties(tokens=tokens+[{'s':'d','t':'1'},])"> Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +54/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
participants (3)
-
A.M. Kuchling -
Andreas Kostyrka -
Anthony Pfrunder