[Zope-CMF] dynamic list of content-types for the zope ZMI
Oliver Bleutgen
myzope@gmx.net
Mon, 07 Jan 2002 19:48:05 +0100
Hi,
I'm trying to find my way through the API for CMF filesystem products.
Bjorn Stabell pointed out to me how to use portal_types + portal_skins
to get a fixed product with changeable "templates".
What I want to do is to write a product which can be added through the
ZMI (not the CMF GUI) and where the user can select which template
it will use (through selecting the portal_type).
The problem is now that I can't know beforehand which different
portal_types will be based on an object of that meta_type, and I'd like
to dynamically gather that list at the moment the user wants to add an
instance.
AFAIK, CMF-products use CMFCore.utils.manage_addContentForm(), which
knows about the content_types lastly from utils.ContentInit(...),
done in the products __init__.py, where content_types =
(tuple_of_objects,) is passed.
Is there a way to stay within the framework (i.e. still use
utils.manage_addContentForm) and get the addForm to show the
content_types dynamically? Using ComputedAttribute perhaps?
cheers,
oliver