Hi
all,
How do I access
"class variables" (properties defined in the folder of my Product - I know it is
not strictly speaking class variables!) when I am rendering my class' add
form? Each product must render a list of checkboxes in the add form to
define parameters of the instance. I want to store that list of choices in
a list in the product and then build the html when the product is added.
That way I can easily change the list without having to write a lot of HTML code
every time.
Here is what I have
done so far:
I have the
following product:
Control_Panel\Products\Indicator
In that folder (the
product folder) I have a property that is called Pressures (a list of items)
(ControlPanel->Products->Indicator->Properties Tab)
This means that
Pressure is a class-ish variable (actually a creation-time variable, or
whatever). I have a method in that folder called renderPressures (Control_Panel\Products\Indicator\renderPressures) which
I want to use to render the list of pressures in the add form with checkboxes
etc.
When rendering the
addform for a user to add a new indicator (non Zope management interface) I do
it as follows in Python script:
return
context.manage_addProduct['Indicator'].Indicator_addForm(context)
This means that
context is passed to the Indicator_addForm and that <dtml-var
renderPressures> will not work since it is "bound" to context, so I use
<dtml-var "manage_addProduct['Indicator'].renderPressures()">
instead.
renderPressures contains something like
pressures =
context.getProperty('Pressures') (also tried container.getProperty('Pressures')
)
but that
returns None and
pressures =
context.manage_addProduct['Indicator'].getProperty('Pressures') also returns
None
Thanks
Etienne