[Zope] Another Question

John Goerzen jgoerzen@complete.org
03 Sep 1999 20:21:11 -0500


Evan Simpson <evan@4-am.com> writes:

> My first guess is that you're using the code above in a DTML Document:  The
> document contains nothing, so nothing is returned.  You need to either use a
> DTML Method instead,  or explicitly call objectValues on the containing folder
> (<dtml-in "myfolder.objectValues('Event')"> or <dtml-in
> "PARENTS[1].objectValues('Event')>).

Excellent, that put me on the right track!  Turns out that PARENTS[0]
is what I needed.  Once I got that working, I make a separate folder
named eventsDb and moved the objects into there, cleaning things up a tad.

Now I've got another question.  Here's my code snippet:

<dtml-in "PARENTS[0].eventsDb.objectValues(['Event'])" sort="when">
  <dtml-var View_HTML>
  <P>
</dtml-in>

Now, View_HTML is a method of the Event object.  I get a nice list
from it.  However, I've got lots of items.  The documentation is clear 
on how to display groups of them.

However, there's a catch: I want to separate the events into previous
and upcoming ones.  Now, inside the loop, I could compare when to
ZopeTime, which would work without separating them into batches.  But
if I'm using batches, this will be horribly messed up.

How can I weed out the ones I don't want *before* I get into the loop?

Thanks,
John Goerzen

-- 
John Goerzen   Linux, Unix consulting & programming   jgoerzen@complete.org |
Developer, Debian GNU/Linux (Free powerful OS upgrade)       www.debian.org |
----------------------------------------------------------------------------+
The 596,185th digit of pi is 4.