def post(self): platform = self.request.get("platform") version = int(self.request.get("version")) url = self.request.get("url") clientversion = ClientVersion(platform = platform, version = version, url = url) clientversion.put() self.render("ClientUpdate.html")
def get(self): pathname = self.request.get("pathname") platform = self.request.get("platform") if pathname: q = ClientFile.all() q.filter("platform =", platform) q.filter("pathname =", pathname) q.order("-version") f = q.fetch(1) if len(f) == 0: self.response.out.write(-1) else: self.response.out.write(f[0].version) else: q = ClientVersion.all() q.filter("platform =", platform) q.order("-version") f = q.fetch(1) if len(f) == 0: self.response.out.write("-1") else: self.response.out.write('{"version":%s, "url": "%s"}' % (f[0].version, f[0].url))