[Zope-CMF] LazyFilter and Effective Dates

David (Hamish) Harvey david.harvey@bristol.ac.uk
Thu, 27 Jun 2002 22:21:52 +0100


--On Thursday, June 27, 2002 22:35:42 +1200 John Morton <jwm@plain.co.nz> 
wrote:

> On Mon, 10 Jun 2002 11:13, seb bacon wrote:
>
> [Discussing Carl Rendell's script to impliment effective date filtering
> in  folders]
>
>> Both if you have time :)  Personally, I can't think of any circumstances
>> where you wouldn't want this to be the default behaviour of
>> objectValues.  I'd even suggest putting it into the CMF, but it may
>> break things for existing applications (though again, I can't imagine
>> how..?)
>
> I noticed that CMFEvents use the effectiveDate and expirationDate to make
> the  beginning and end of an event, which is an entirely different
> semantics from  the intended publishing ones, so putting a date filter in
> folders would end  up mildly breaking that product.

Reading this caused me to have another look at Event.py, as I was puzzled 
by this apparent anomaly before. If it were the case you could argue that 
Event mildly breaks everything else :-) I thought it was, too, but I've 
just had another look at the source, and I'm not sure it is - I think it's 
a funny bit of parameter naming. Notice that addEvent, Event.__init__ have 
effective_date and start_date parameters. Event.edit has effectiveDay, 
..Month, ..Year, and start_time parameters, but they all get squashed into 
a DateTime and that is stored in the start_time attribute.

The two strange things about Event are, it seems to me:
1) it misnames startDay, startMonth, startYear
2) it includes effective/expiration dates in the creation/edit interface, 
rather than (as well as?) the metadata interface.

> Perhaps effectiveDate and expirationDate policy is best implemented in
> workflows, assuming there's a good way to get the content to
> automatically  move in and out of being published as the days tick over.

The two issues are orthogonal: you can have an item which is published, but 
not effective yet (or no longer effective). If you need to actually change 
the workflow state as the days go by a) you'd need to keep checking 
everything and b) you'd need to introduce a new workflow state to mean 
"published but not visible".

Cheers,
Hamish