[Zope-dev] Re: BTW: CalendarTag

michel@digicool.com michel@digicool.com
17 Jul 1999 03:06:01 -0400


Jason Spisak <webmaster@mtear.com> writes:

> Kent,
> 
> > Plese report back with how you use things like this. It's only neat
> > to see one's ideas be used, but what's really cool is when someone
> > comes up with something I can learn from. :^)
> 
> Well I don't know if you can learn from me, but here's how I've used it.
> 
> Each user can create objects that have a calendar_date property, which
> means that they have some scheduling significance.  I use the ZCatalog
> to show me the things that occur on the day that the Calendar is set to.
>  In month mode I munged a way to make the date red if they have things
> occuring on that day. Also, the owner is just a property where I store
> the user name when the ZClass instance get created.  I index them by
> owner, and calendar_date.  This way all users log on to the same page,
> and all of them see "thier" calendar.
> 
> Not pretty, but it works-->
> 

I notice you do:


<!--#in "Catalog(recruiter=AUTHENTICATED_USER.getUserName())"-->
  ...
<!--#/in-->

several times in your calendar/catalog example.

You can optimize this using the with or let tags to run this query
just once and stuff it into a name you can reuse.  This will make the
page render much faster.

<!--#with "_(recruiter_stuff =
Catalog(recruiter=AUTHENTICATED_USER.getUserName())"-->

  <!--#in recruiter_stuff-->
    ...
  <!--#/in-->

  <!--#in recruiter_stuff-->
    ...
  <!--#/in-->

<!--#/with-->

-Michel