<tal:unique_loop define="global items_unique python: " repeat="item items"> <span tal:condition="python: item not in items_unique"> <tal:append define="dummy python: items_unique.append(item)" /> <tal:output content="item" /> </span> </tal:unique_loop>
Zope ZPT Output only unique items from a list
You can leverage ZPT global variables to output unique items from a list.
The subset of python methods available to Zope is limited, so using global variables is a workable way to create a list of unique items.
Snippet Viewed 1671 times.
Share your Zope ZPT code snippets:
- Get some recognition & a link back to your site.
- Create your own code library.
- Help your fellow developers, as they have helped you.