[Zope] Creating a directory using Zcatalog and either tree or some other method

Chris Muldrow muldrow@mac.com
Wed, 07 Mar 2001 10:48:46 -0500


OK, here goes another convoluted question:

I've got news stories in a Zcatalog. I want to build a directory of said
stories. Each story contains multiple properties, with the key properties
being title, CreateDate (the date the story was created), Category (Sports,
Local, Features, etc.) and Locality (Stafford, Spotsylvania, etc.) I want to
build this directory so it displays all of today's stories. I want to
display them under headers using the following criteria: If
Category=='Local', then print a header for the localities and sort them.
Otherwise, print a header for the categories. Here's how it should look:


Spotsylvania (This is the locality)
  Headline 1
  Headline 2 
  Headline 3 (all of these stories have category "Local")
Stafford 
  Headline 1
  Headline 2 
  Headline 3 (all of these stories have category "Local")
Sports (This is the category)
  Headline 1
  Headline 2 
Features (This is the category)
  Headline 1
  Headline 2 


This code pulls out all of my stories for today's date. My problem is
sorting them under the category headers:
<dtml-in expr="Catalog(CreateDate=[ZopeTime()-1,ZopeTime()],
CreateDate_usage='range:min:max')">


-- Chris Muldrow, muldrow@mac.com