Personal tools
You are here: Home Documentation Manuals Archetypes Developer Manual A simple AT Product The configuration module
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

2.4. The configuration module

Up one level
The configuration details for your content type.

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.

by Kamon Ayeva last modified December 1, 2006 - 20:14
Contributors: Sisi Nutt, Alexander Limi, Martin Aspeli, Marco De Vitis, Raphael Ritz, Maik Röder, Steve McMahon
All content is copyright Plone Foundation and the individual contributors.

include file names

Posted by Alexander Stockdale at May 20, 2008 - 19:32
At the beginning of each tutorial section (or whenever the focus changes to a new file), please include the name of the file that you are examining. Yes, it's probably obvious, and yes, the files are available for download, but it would make things clearer.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by