[Zope] Dictionary properties within Zope.

Andreas Kostyrka andreas@mtg.co.at
Sun, 29 Aug 1999 20:34:04 +0200 (CEST)


On 29 Aug 1999 happyrhino@usa.net wrote:

> I'm embarassed to be asking yet another silly question but
> after 40 minutes searching the archives and the documentation,
> can't find it. Hopefully it'll be short and sweet =
> 
> I can add properties which can be lines, strings, numbers.
> But hasn't anyone found the need to add dictionaries ?
> In almost every website I've created, the global configuration
> files are full of dictionary variables. 
> For example, for navigation menus we might have 
> navigation = {"Title 1" : URL1, "Title2" : URL2, etc}
> from which it's then simple to generate the HTML for the navigation.
> And there are many other instances where dictionaries save the day.
The problem with this approach is, that you need at least three parts:
title, url, and sort key.

Actually, this can be done much nicer in ZOPE with the Navigation Product.

> This would have been something very useful to put in the root
> folder properties as a form of "site configuration". 
Well, this is not actually the ZOPE Zen, as it is absolutly non object
oriented. What if you delete some object? Or rename it? ...

> The only references to dictionaries seem to be with respect to the
> REQUEST.cookies and REQUEST.form and DTML doesn't seem to have the 
> mechanisms for dealing with dictionary properties on folders.
Well, you can always set them in DTML methods yourself ;)
But navigation surely is the wrong usage for dictionaries ;)

Andreas
--
Andreas Kostyrka                     | andreas@mtg.co.at
phone: +43/1/7070750                 | phone: +43/676/4091256   
MTG Handelsges.m.b.H.                | fax:   +43/1/7065299
Raiffeisenstr. 16/9                  | 2320 Zwoelfaxing AUSTRIA