[Zope-dev] Zcatalog q: howto do a NOT?

Stuart 'Zen' Bishop zen@cs.rmit.edu.au
Fri, 12 Nov 1999 13:09:51 +1100 (EST)


On Thu, 11 Nov 1999, Jos Yule wrote:

> I want to do a ZCatalog search on this property, excluding all Objects which
> have a certain value some where in the list property...
> How the heck do i do this? 
> How do i do a plain <dtml-if "myObject.myPropertyList != 'aValueIDontwant'">
> ? I can't figure out the proper DTML syntax...

I think you will need to retrieve all all results, and skip items
that you don't want:

<dtml-in Catalog> <dtml-comment> Select everything </dtml-comment>
  <dtml-with sequence-item>
    <dtml-if "'aValueIDontWant' not in myPropertyList">
      Something
    </dtml-if>
  </dtml-with>
</dtml-in>

With the syntax errors fixed of course :-)

 ___
   //     Zen (alias Stuart Bishop)     Work: zen@cs.rmit.edu.au
  // E N  Senior Systems Alchemist      Play: zen@shangri-la.dropbear.id.au
 //__     Computer Science, RMIT 	 WWW: http://www.cs.rmit.edu.au/~zen