def post(self): logging.debug("post new") lt = LocationTrace() lt.create(self.request.POST,{'user':users.get_current_user()}) for (k,v) in self.request.POST.iteritems(): logging.debug(k+","+str(v)) lt.put()
def get(self): for (k,v) in self.request.GET.iteritems(): logging.debug(k+","+str(v)) user = users.get_current_user() #display all the traces if user is admin if users.is_current_user_admin(): locations = LocationTrace.all() else: locations = LocationTrace.all().order('timestamp').filter("user = ", user) template_values = {'locations':locations} CustomHandler.get(self, os.path.dirname(__file__), template_values)
def get(self,key): location = LocationTrace.get(key) if not location: return self.error(404) self.response.headers['Content-Type'] = 'audio/amr' self.response.out.write(location.location)
def get(self): for (k,v) in self.request.GET.iteritems(): logging.debug(k+","+str(v)) user = users.get_current_user() samples = Sample.all().order("-timestamp") #display all the samples if the user isn't logged in or is admin if user and not users.is_current_user_admin(): samples = samples.filter("user = "******"user = "******"timestamp <= ", samples[0].timestamp).filter("timestamp >= ", samples[-1].timestamp).fetch(1000) fun = [] noisy = [] for sample in samples: if sample.type == "Fun": fun.append(sample) else: noisy.append(sample) template_values = {'fun':fun, 'noisy':noisy, 'traces':traces, 'next':next, 'prev': prev, 'amount':amount} CustomHandler.get(self, os.path.dirname(__file__), template_values)