[Zope] Adding attributes to PageTemplateFile

Carsten Gehling carsten at gehling.dk
Thu Sep 11 16:37:07 EDT 2003


I have a product in which I have the following constructor

------------------------------------
software_type_list = [
    {'value': 'OS'},
    {'value': 'Applikation'},
    {'value': 'Service'}
]

manage_addSoftwareForm = PageTemplateFile("www/software_form_add",
globals())
------------------------------------
In the "software_form_add" file I want to be able to access the list
"software_type_list" like this:

------------------------------------
<select accesskey="o" size=1 name="type">
    <option tal:repeat="option here/software_type_list"
            tal:attributes="value option/value"
            tal:content="option/value">
        Value
    </option>
</select>
------------------------------------

But I don't know how I make the "software_type_list" accessable in my
template file. I've tried this:

manage_addSoftwareForm = PageTemplateFile("www/software_form_add",
globals(), software_type_list = software_type_list)

which doesn't work. I seem to recall seeing something about adding
software_type_list to the context, but I can't find it anymore.

Any ideas? TIA

- Carsten




More information about the Zope mailing list