[Zope] DTML-In with date/time filter

Martin Koekenberg martin at digital-adventures.nl
Wed May 3 06:17:36 EDT 2006


 
 Hallo,
I can create a dtml-in filte with the following code:

return [doc for doc in context.objectValues('DTML Document')  if 
doc.getProperty('a')!='de'] 

How can I do the same with a date or time ?

Regards,

Martin Koekenberg
 
 


-----Original Message-----
From: Tino Wildenhain <tino at wildenhain.de>
To: Martin Koekenberg <martin at digital-adventures.nl>
Cc: zope at zope.org
Date: Wed, 08 Mar 2006 14:43:41 +0100
Subject: Re: [Zope] DTML-In with filter


Martin Koekenberg schrieb:
> Hello,
>  
> Is it possible to use a DTML-In to display all DTML Documents in a 
> folder exept the one's with a centain value in a property ?
>  
> Example.
>  
> DTML Document one with property a=bc
> DTML Document two with property a=de
> DTML Document three with property a=bc
>  
> Now I want to use DTML-IN to display all the dtml documents except the 
> ones with property a=de.
> I also use the size and batchsize property to create links to the next 
> 10 documents..... If I use an if statement the next 10 can be 9 ore 
> less 9 items because there could be one ore more documents with a=de.

Just drop this DTML... or at least get help from python:

return [doc for doc in context.objectValues('DTML Document')  if 
doc.getProperty('a')!='de']

(python script or the like would be your friend - also
it makes it possible to replace the quite costy objectValues()
call with ZCatalog query w/o changing your presentation code)

Regards
Tino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20060503/1fb44ffa/attachment.htm


More information about the Zope mailing list