Zope ZPT Controller Python Script Metadata conditional

You have some control over actions in the controller python script metadata file if you use a python expression.
Many examples on the web illustrate the use of a string expression, but you have some additional options at your disposal if you use a python expression.
[default]
proxy=Manager,Anonymous

[actions]
action.success = traverse_to:string:process_page
action.failure = traverse_to:python:test(request.get('alternate', ''), 'page-alternate', 'page-original')
Posted by
Snippet Viewed 1157 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.

 

Submit | Browse

Most Recent zope zpt snippets

Most Viewed