def post(self): hunt_name = self.request.get('hunt-name') hunt = Hunt.all().filter('name =', hunt_name).get() if not hunt: hunt = Hunt(name=hunt_name, owner=self.user) hunt.put() self.redirect('/hunt/%s' % hunt.key().id())
def post(self): hunt_name = self.request.get("hunt-name") hunt = Hunt.all().filter("name =", hunt_name).filter("owner =", self.user).get() if not hunt: hunt = Hunt(name=hunt_name, owner=self.user) hunt.put() self.redirect("/hunt/%s" % hunt.key().id())
def get(self): hunts = list(Hunt.all().filter('owner =', self.user)) self.response.out.write(utils.render('templates/index.html', {'hunts': hunts}))
def get(self): user = users.get_current_user() hunts = [] if user: hunts = list(Hunt.all().filter('owner =', user)) self.response.out.write(utils.render('templates/index.html', {'hunts': hunts}))
def get(self): hunts = list(Hunt.all().filter("owner =", self.user)) self.response.out.write(utils.render("templates/index.html", {"hunts": hunts}))