[Zope-CMF] Re: Effective use of effective_date and expiration_date
Raphael Ritz
r.ritz at biologie.hu-berlin.de
Tue Aug 29 03:15:38 EDT 2006
Tres Seaver schrieb:
[..]
>
> Yep -- this is how the "typical" site uses those dates. However, some
> folks want actual workflow transitions to happen ASAP after each date
> passes. In that case, you need to write a periodic task which searches
> for objects which are in the "between" state (e.g., their expiration
> date has passed but they are still "active"), and cause the workflow
> tool to "tickle" the transition machinery. E.g., as a Python Script::
>
> # untested
> for brain in context.portal_catalog.searchResults(
> review_state="published",
> expiration_date={'query': ZopeTime(),
> 'operator': 'max'}):
> obj = brain.getObject()
> wf_tool.doActionFor(ob, 'expire')
>
>
Yep. And just reinforcing the obvious:
Trigger the script Tres mentioned on a regular basis
yourself, either using a cron job or Zope's ClockServer
from Chris (included in Zope 2.10 now?)
http://plope.com/software/ClockServer/
Raphael
More information about the Zope-CMF
mailing list