2.4.
The configuration module
Up one level
First we have to import a class from Archetypes:
from Products.Archetypes.public import DisplayList
Displaylist is a data container we use when displaying
pulldowns/radiobuttons/checkmarks with different choices. Let's say we wanted
priorities on our instant messages, and we wanted those to be High, Normal
and Low. We will specify these later in the file.
The next two lines set the project (Product in Zope) name, and point to the
skin directory. PROJECTNAME should reference the name of the package: InstantMessage.
PROJECTNAME = "InstantMessage"
SKINS_DIR = 'skins'
The next line sets a GLOBALS reference point, calling Python's 'globals' function:
GLOBALS = globals()
This is used later during the product's installation phase for things like finding the Product directory (see the Install.py later).
Now we are done with the generic setup. Then we need to specify our 'Priority' pulldown. It should look like this, using the DisplayList utility class that Archetypes has provided for exactly that purpose:
MESSAGE_PRIORITIES = DisplayList((
('high', 'High Priority'),
('normal', 'Normal Priority'),
('low', 'Low Priority'),
))
Python notes:
The reason for double parantheses is that DisplayList is a class that you pass a tuple of tuples to.
include file names