[Zope-CMF] Re: Effective use of effective_date and expiration_date
Philipp von Weitershausen
philipp at weitershausen.de
Tue Aug 29 04:16:03 EDT 2006
Raphael Ritz wrote:
> 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/
Yup, included.
More information about the Zope-CMF
mailing list