[Zope] How do I make an editable lists to fill a selection list?

Rik Hoekstra rik.hoekstra@inghist.nl
Fri, 7 Apr 2000 17:27:27 +0200


>I currently have a form that allows me to select a choice of keywords to
>describe an Item that I am entering into a Zope object. (See
>http://phoebe.rider.edu:8080/Athena/entries/entry_addForm (more
>specifically, the Database Keywords check-boxes)). This is one of
>about 25 fields. I am currently generating the list of selection keywords
>using a dtml-in hard-coded loop as described in AlexR's How-to on
>selection lists (http:www.zope.org/Members/AlexR/SelectionLists). This
>works fine, but I would like to get this values from a list stored in
>another object/method/file/(?) that can be edited more easily (hopefully,
>via a web form. My question is, how should I begin to do this?

Hm, the question is not entirely clear to me. You could get/store these
values in many ways.

> Besides
>needing a way to call the list into my loop, I need to figure out how
>/where to store the list.

Using a list in dtml, you could use anything that returns a Python list or
can be turned into a list. This includes (for example) SQL databases, Tiny
Tables, Zcatalogs and in general anything that returns a ResultSet (if I
remember the term correctly).

Objects also have properties. Property types that return a list include
token and lines.
Properties can be manipulated with manage_editProperties and
manage_changeProperties (see for a short guide the ZQR at
http://zdp.zope.org/projects/zqr) or some of the DTML guides. If you define
ZClasses you may do even more complicated things with propertysheets.

Hard coded lists could also be returned from DTML methods residing in the
acquisition path of an object. For example:

<dtml-return expr="['a', 'b', 'c']">, but you could also imagine more
intricate things. The same may be accomplished by PythonMethods or External
Methods.

You, see, too many possibilities. It depends on what exactly you want what
you need. If you provide more details, we may be able to help you somewhat
more.

> Any starting points would be greatly
>appreciated.
>


hth

Rik