Back to index

plone3  3.1.7
Classes | Functions | Variables
plone.app.portlets.portlets.calendar Namespace Reference

Classes

class  ICalendarPortlet
class  Assignment
class  Renderer
class  AddForm

Functions

def _render_cachekey

Variables

tuple PLMF = MessageFactory('plonelocales')

Function Documentation

def plone.app.portlets.portlets.calendar._render_cachekey (   fun,
  self 
) [private]

Definition at line 36 of file calendar.py.

00036 
00037 def _render_cachekey(fun, self):
00038     context = aq_inner(self.context)
00039     if not self.updated:
00040         self.update()
00041 
00042     if self.calendar.getUseSession():
00043         raise ram.DontCache()
00044     else:
00045         key = StringIO()
00046         print >> key, getToolByName(context, 'portal_url')()
00047         print >> key, cache.get_language(context, self.request)
00048         print >> key, self.calendar.getFirstWeekDay()
00049 
00050         year, month = self.getYearAndMonthToDisplay()
00051         print >> key, year
00052         print >> key, month
00053 
00054         start = DateTime('%s/%s/1' % (year, month))
00055         end = DateTime('%s/%s/1' % self.getNextMonth(year, month)) - 1
00056 
00057         def add(brain):
00058             key.write(brain.getPath())
00059             key.write('\n')
00060             key.write(brain.modified)
00061             key.write('\n\n')
00062 
00063         catalog = getToolByName(context, 'portal_catalog')
00064         brains = catalog(
00065             portal_type=self.calendar.getCalendarTypes(),
00066             review_state=self.calendar.getCalendarStates(),
00067             start={'query': end, 'range': 'max'},
00068             end={'query': start, 'range': 'min'})
00069 
00070         for brain in brains:
00071             add(brain)
00072 
00073         return key.getvalue()
00074 

Here is the call graph for this function:


Variable Documentation

tuple plone.app.portlets.portlets.calendar.PLMF = MessageFactory('plonelocales')

Definition at line 22 of file calendar.py.