def post(self): s = Trackday.query() for _s in s: _s.key.delete() trackday = Trackday(jsondata = self.request.body, lastUpdated=datetime.datetime.now()) trackday.put()
def post(self): s = Trackday.query() for _s in s: _s.key.delete() trackday = Trackday(jsondata=self.request.body, lastUpdated=datetime.datetime.now()) trackday.put()
def get(self): clientupdated = self.request.get("lastupdated") self.response.headers['Content-Type'] = 'application/json' try: trackdays = Trackday.query() for trackday in trackdays: if trackday.lastUpdated: self.response.out.write(trackday.lastUpdated) if(trackday.lastUpdated > clientupdated) : self.writeData(trackday.jsondata) #self.response.out.write(trackday.jsondata) else: self.writeData(trackday.jsondata) except Exception: e = sys.exc_info()[0] logging.info('error getting trackdays from db %s' % str(e))
def get(self): clientupdated = self.request.get("lastupdated") self.response.headers['Content-Type'] = 'application/json' try: trackdays = Trackday.query() for trackday in trackdays: if trackday.lastUpdated: self.response.out.write(trackday.lastUpdated) if (trackday.lastUpdated > clientupdated): self.writeData(trackday.jsondata) #self.response.out.write(trackday.jsondata) else: self.writeData(trackday.jsondata) except Exception: e = sys.exc_info()[0] logging.info('error getting trackdays from db %s' % str(e))