[Zope-CMF] Again: Proposal for CMF Calendar
Chris Withers
chrisw at nipltd.com
Wed Aug 6 13:17:38 EDT 2003
Submit a patch & some tests to http://collector.zope.org/CMF and someone will
merge them in :-)
Chris
Ignacio Dosil Lago wrote:
> I support your proposal. At least it's useful for me.
>
> On Jueves 03 Julio 2003 14:04, Rainer Thaden wrote:
>
>>Hi,
>>
>>hm, either everyone's in holidays or nobody is interested. Once again
>>a proposal for CMFCalendar to show not only events with review state =
>>published but all events which the user is allowed to view:
>>
>>In CalendarTool.py:
>>
>> security.declarePublic('catalog_getevents')
>> def catalog_getevents(self, year, month):
>>
>> last_date=first_date + last_day
>>
>> query=self.portal_catalog(portal_type=self.calendar_types,
>># remove this line review_state='published'
>> start=(first_date, last_date),
>> start_usage='range:min:max',
>> sort_on='start')
>>
>> query+=self.portal_catalog(portal_type=self.calendar_types,
>># remove this line review_state='published'
>> end=(first_date, last_date),
>> end_usage='range:min:max',
>> sort_on='end')
>>
>>#add next line
>> query = ZTUtils.LazyFilter(query, skip='View')
>>
>>
>> security.declarePublic('getEventsForThisDay')
>> def getEventsForThisDay(self, thisDay):
>> catalog = self.portal_catalog
>>
>> first_date, last_date = self.getBeginAndEndTimes(thisDay.day(),
>>thisDay.month(), thisDay.year())
>>query=self.portal_catalog(portal_type=self.calendar_types, # remove this
>>line review_state='published'
>> start=(first_date,last_date),
>> start_usage='range:min:max')
>>
>> query+=self.portal_catalog(portal_type=self.calendar_types,
>># remove this line review_state='published'
>> end=(first_date,last_date),
>> end_usage='range:min:max')
>>
>> query+=self.portal_catalog(portal_type=self.calendar_types,
>># remove this line review_state='published'
>> start=first_date,
>> start_usage='range:max',
>> end=last_date,
>> end_usage='range:min')
>>#add next line
>> query = ZTUtils.LazyFilter(query, skip='View')
>>
>>Comments?
>
>
>
> _______________________________________________
> Zope-CMF maillist - Zope-CMF at zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
>
> See http://collector.zope.org/CMF for bug reports and feature requests
>
>
More information about the Zope-CMF
mailing list