Mailing List Archive

[Zope-PTK] event ZClass
Hi everybody,

I remember that someone mentioned they were working on an event ZClass. Am
I remembering correctly? Is so, I'd love to hear how it's coming because
I'm very interested in something similar.

-Tim

--
Tim Wilson | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN | | http://slashdot.org/
wilson@visi.com | <dtml-var pithy_quote> | http://linux.com/
Re: [Zope-PTK] event ZClass [ In reply to ]
>>>>> "Timothy" == Timothy Wilson <wilson@visi.com> writes:

Timothy> Hi everybody, I remember that someone mentioned they were
Timothy> working on an event ZClass. Am I remembering correctly?

Yep.

Timothy> Is so, I'd love to hear how it's coming because I'm very
Timothy> interested in something similar.

Ok. I'm not saying that this is the "right" way; it may be possible to
do this from the web via Z classes. I basically gave up and hacked the
PTK Python code directly, and I probably did it in a
not-very-nice-way, but oh well, it works. :)

I wanted my Event class to be similar to a NewsItem but with an extra
eventdate property, so that I could use dtml-calendar to create quick
links to events. So I copied NewsItem.py and began hacking. "Hacking"
in this case was basically replacing all occurences of NewsItem, news
item and News Item with Event. :) I also modified the constructor to
take an extra eventdate argument.

Then I hacked PTKBase/__init__.py. I changed a portion of it to look
like:

context.registerBaseClass(NewsItem.NewsItem, 'News Item')
context.registerBaseClass(Document.Document,'Document')
context.registerBaseClass(Link.Link, 'Link')
context.registerBaseClass(Event.Event, 'Event')

I then copied the News Item wizard, changed references from News to
Event, and added code to support inputing a date. Then I copied
newsEdit.dtml and added a similar input field, with
value="&dtml-eventdate;", which made event editting work
nicely. Finally, I hacked the Recent News pages so that the meta_data
in the Z catalog search would search for ['News Item', 'Event']
instead of just news, since they're both intended to serve identical
purposes. And that was it; I now have an Event class which serves my
purposes nicely. Hopefully I haven't broken compatibility with future
versions of the PTK; I hate modifying code locally and making my
version of something nonstandard, even if it is only slightly so.
Re: [Zope-PTK] event ZClass [ In reply to ]
I'm working on ZScheduler which implements basic scheduled events. It's not
related to PTK. Discussion is on zope-dev@zope.org. I just got something
functional running. If you like to play with fragile SW, check it out at
http://www.zope.org/Members/lstaffor/ZScheduler

Let me know whether it fits your needs.

-- Loren

----- Original Message -----
From: Timothy Wilson <wilson@visi.com>
To: <zope-ptk@zope.org>
Sent: March 06, 2000 11:55 AM
Subject: [Zope-PTK] event ZClass


> Hi everybody,
>
> I remember that someone mentioned they were working on an event ZClass. Am
> I remembering correctly? Is so, I'd love to hear how it's coming because
> I'm very interested in something similar.
>
> -Tim
>
> --
> Tim Wilson | Visit Sibley online: | Check out:
> Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
> W. St. Paul, MN | | http://slashdot.org/
> wilson@visi.com | <dtml-var pithy_quote> | http://linux.com/
>
>
> _______________________________________________
> Zope-PTK maillist - Zope-PTK@zope.org
> http://lists.zope.org/mailman/listinfo/zope-ptk
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
requests
>