Zope ZPT HTML select options from python dictionary

You can use a python dictionary to dynamically build your HTML select option list.
<select name="ship_method" tal:define="products python:{'item1':'Item 1', 'item2': 'Item 2'}">
	<option tal:repeat="product python: products.keys()" tal:attributes="value product;" tal:content="python: products[product]" />
Posted by
Snippet Viewed 1234 times.

Share your Zope ZPT code snippets:

  • Get some recognition & link back to your site.


Submit | Browse

Most Recent zope zpt snippets

Most Viewed