def get(self, url): p = Page.all().filter('url =', url).get() if p: h = Page.all().filter('url =', url).order('-created').fetch(15) self.render('history.html', history=h, user=self.user) else: self.redirect('/_edit' + url)
def get(self, url): p = Page.all().filter('url =', url).get() if p: h = Page.all().filter('url =', url).order('-created').fetch(15) self.render('history.html', history = h, user=self.user) else: self.redirect('/_edit'+url)
def get(self, url): if not self.user: self.redirect('/login') v = self.request.get('v') p = None if v: if v.isdigit(): p = Page.get_by_id(int(v)) if not p: self.error(404) return else: p = Page.all().filter('url =', url).order("-created").get() self.render('edit.html', page=p, user=self.user)
def index(): pages = sorted(Page.all(), key=Page.date, reverse=True) return render_template("index.html", pages=pages)