Пример #1
0
 def get(self, parent, update = False, **kwargs):
     res = Cache.get(COMMENTDB, parent, **kwargs)
     if not res or update:
         res = Transaction(COMMENTDB).query(parent = parent, **kwargs)
         if res == None:
             res = NoneResult
         Cache.set(COMMENTDB, parent, res,**kwargs)
     return None if res == NoneResult else res
Пример #2
0
 def get(self, parent, update = False, **kwargs):
     order = kwargs.pop('order', None)
     if not order:
         order = '-datetime'
     res = Cache.get(CALENDARDB, parent,order = order, **kwargs)
     if not res or update:
         res = Transaction(CALENDARDB).query(parent = parent, order = order,  **kwargs)
         Cache.set(CALENDARDB, parent, res if res else NoneResult, **kwargs)
     return None if res == NoneResult else res