Beispiel #1
0
 def post(self):
   if not self.request.headers.get("X-AppEngine-QueueName", False):
     logging.error("request was not from task queue API")
     return
   else:
     name = self.request.get("name",False)
     state = self.request.get("state",False)
     city = self.request.get("city",False)
     ip = self.request.get("ip",False)
     timestamp = self.request.get("timestamp",False)
     #log((name,state,city,ip,timestamp))
     if name and state and city:
       # assuming it is all right
       Votings.update_one((name,city,state),
                          ip,
                          timestamp) # this will update csv contents of Votings model
Beispiel #2
0
 def getmethod(self):
   self.response.headers["content-type"] = "text.csv"
   filename = "vote_counts_%s.csv" % time.strftime("%d.%m.%Y")
   self.response.headers["Content-Disposition"] = "attachment;filename=%s" % filename
   self.response.out.write(Votings.get_vote_counts_csv())