[Zope] Calendar Rendering Tag

Andrew M. Kuchling akuchlin@mems-exchange.org
Fri, 16 Jul 1999 15:17:05 -0400 (EDT)


Schmidt, Jens-Uwe writes:
>has anybody implemented a calendar using the Calendar rendering tag and
>knows, where to find some documentation or a short howto?

	Here's a sample usage.  In my DTML, I have:

<!--#calendar-->
  <!--#var expr="render_day(REQUEST=REQUEST, resource=resource, date=date)"-->
<!--#/calendar-->

'resource' and 'date' are already set.  render_day() is an
ExternalMethod that consists of Python code.  Cutting it down to
something small, the function looks like this:

def render_day(self, REQUEST=None, RESPONSE=None, resource=None, date=None):
    # list_day_events() is a ZSQLMethod, but you can do whatever you like.
    events = self.sql.list_day_events(resource=resource, today_date=date)

    html = "HTML content for the date %(date)s goes here." % vars()
    return html

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
It would be nice to be unfailingly, perpetually, remorselessly funny, day in
and day out, year in and year out until somebody murdered you, now wouldn't it?
    -- Robertson Davies, _The Diary of Samuel Marchbanks_