示例#1
0
    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()
示例#2
0
    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()
示例#3
0
 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))
示例#4
0
 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))