[Zope] Calendar (was: Portal idea)

chas panda@skinnyhippo.com
Sun, 05 Sep 1999 03:58:19 +0900


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
>> 
>> b) regular events.
>>     eg. each monday, wednesday and friday for event D
>>         each saturday at 4 pm for event E
>>    this is ok in zope
>> 
>> c)  between 2 dates. eg. starts on 2 october and ends 28 october.
>>     this is ok in zope too
>
>How about an abstract Event class.  The class should have a method that
>given a date returns true/false depending if the event occurs on that date.
>Now you just subclass as needed to support recurring, one-off or ranges
>Event objects.  Would this work?

at first blush, yes. 

but...

>Could you then use ZCatalog to find all events occuring on a certain date?

 ... it still leaves the issue of storing the events of type 'a' within 
zcatalog... it's a one-to-many relationship. say you have an event that
occurs on 1st Sept, 4th Sept, 11th Sept, 14th Sept... you end up having
to store this in a list (which gets ugly quickly when doing loads of 
date manipulation) or multiple date fields (which introduces redundancy). 

i'm not saying its not doable (the lists are probably the way to go), just
wondering whether the rdb is not the better solution. 

hell, it's a nice little thing to test out - will get back to you later
on it .

chas