[Zope] soft references again
Jason Spisak
444@hiretechs.com
Wed, 31 May 2000 16:22:31 GMT
Jerome Alet writes:
Well I wrote a long and glorious reply and then my email client trashed it.
So here's the abreviated version.
> Hi,
>
> I'm currently beginning to create my calendar with a GenericEvent Zclass
> I've just created. This Zclass has a property named date (perhaps a bad
> name) of type date which contains the date (YES !) on which the event
> happen, as well as propeties named hour_begin, minutes_begin, hour_end,
> minutes_end of type string which contain respectively the beginning and
> ending hour of the event, and a title and description of the event.
>
That seems like a lot of separate properties when all you need is 2.
1. Start Time
2. End Time
Both date properties. Then you can turn them into any format you want.
(minutes/seconds/week of the year)
Check out the DateTime formats here:
http://www.zope.org/Members/ZQR/zqr/HTMLversion
> I've got a question regarding what you sent to me:
>
> On Mon, 15 May 2000, Jason Spisak wrote:
>
> > I have a calendar here that has folders for each "user" and displays the
> > calendar of their events by having the Catalog search for the "day" on
> > which the events occur. For each object that I want to appear in the
> > calendar I have an external method that simply takes whatever date is the
> > "Calendar Date" and returns the integer day. Then the Catalog does the
> > rest.
> > ...
> > <dtml-in "Catalog(user=AUTHENTICATED_USER.getUserName(),
> > meta_types=['Interview', 'Call', 'Appointment', 'Deal'],
> > calendar_day=_.int(date)/100000)">
>
> I don't really undertand why you convert the date to integer format with
> your calendar_day external method and the calendar_day index in the
> ZCatalog.
>
The conversion gives me the exact day and will be unique, that is not
repeating the next year.
> Why don't you do something like:
>
> <dtml-in "Catalog(user=AUTHENTICATED_USER.getUserName(),
> meta_types=['Interview', 'Call', 'Appointment', 'Deal'],
> yourdateproperty=date">
>
> after having created an index named yourdateproperty in the ZCatalog,
> which in my particular case would be:
>
> <dtml-in "Catalog(meta_types=['GenericEvent'], date=date">
>
> Isn't the Catalog able to index fields of type date ?
>
Yep, use a FieldIndex. But remember when you are asking for DateTime
object equivilancy you must be exact. Time Zone and all. What you have
outlined seems like it should work, but it is less flexible. What happens
when someone's appointment spans two days? Can you easily determine how
long an appointment will last and figure out if there is anough time
available to accomodate it? With two DateTime objects those things are
quite easy. With strings it requires a lot of maipulation.
Hope I haven't confused you further. ;)
Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.