Developer's Guide

  • Docs Home
  • Community Home

2. Plugins

Reports are often summaries which are not tied to a particular object. Instead of adding code to objects to make them available in the page template, you can put the python code for a report in the $ZENHOME/Products/ZenReports/plugin directory.

You can execute a plugin using this tal:block:

<tal:block tal:define="
objects python:here.ReportServer.plugin('cpu', here.REQUEST);
"

...

</tal:block>

Plugins are executed every time a report is run, and do not require a Zope restart to get pick up changes. With help from the ZenReports? Plugin module, you can even test the reports from the command line. This further reduces the number of times that Zope is used as a development environment.

See the examples in the plugins directory.