Ejemplo n.º 1
0
 def post(self):
   user_email = self.request.get('user_email')
   user_key = ndb.Key(GaeUser, user_email)
   user = user_key.get()
   date_text = self.request.get('date')
   service = TimelogEventService(user)
   service.process_events(date_text)
Ejemplo n.º 2
0
 def get(self):
   user = GaeUser.query().get()
   if not user:
     raise RuntimeError('user not saved in datasotre, run /fetch_calendar first')
   user_email = user.email
   service = TimelogEventService(user)
   failed_history_list = service.query_failed_history_list()
   for failed_history in failed_history_list:
     date_text = datetime_util.date_to_str(failed_history.date)
     taskqueue.add(url='/calendar_fetch_worker',
                   params={'user_email': user_email, 'date': date_text})
     self.response.write('<p>Launched fetch with user_email: %s on %s</p>' %
         (user_email, date_text))