[Zope] Calendar (was: Portal idea)
Kevin Dangoor
kid@kendermedia.com
Sat, 4 Sep 1999 15:54:01 -0400
-----Original Message-----
From: chas <panda@skinnyhippo.com>
To: Itamar Shtull-Trauring <itamars@ibm.net>; Zope-l <zope@zope.org>
Date: Saturday, September 04, 1999 3:40 PM
Subject: Re: [Zope] Calendar (was: Portal idea)
>At 07:27 PM 9/4/99 +0200, Itamar Shtull-Trauring wrote:
>>chas wrote:
>>
>>> just as a side note, you might want to think about the nature of the
>events.
>>> i've found that it's better to stick with rdb for events-listings
because
>>> my events fall into 3 categories when it comes to the dates/times :
>>>
>>> a) one-off events. eg. you specify the dates.
>>> eg. 19 oct 1999, 2 nov 1999 for event A
>>> 1 nov 1999 for event B
>>> ....
>>> which results in a one-to-many relationship
I don't think there are many applications where an rdb is really going to be
much cleaner than the ZODB. (Though I think there may be a number of
situations where the ZODB is cleaner, but maybe I'm just an object bigot :)
The really straightforward thing to do would be something like this:
Event ZClass (inherits from CatalogAware, ObjectManager)
- EventDate ZClass (may inherit from CatalogAware for doing date-range
manipulation)
Event could have a function, as Itamar suggested, that zips through the
EventDate objects (<dtml-in "objectValues('EventDate')">) and sees if there
is a match.
Or, you could grab all matching EventDate objects (through the Catalog) and
then use parent[1] to get the Event info.
This is a one-to-many relationship with no redundancy, and it should perform
pretty well, I think.
You could, of course, use a list property instead of an EventDate ZClass...
but I don't think you would get the same Catalog benefit then.
Kevin