def page(self, page): # Return a rendered template c.page = int(page) page = c.page - 1 c.statuses = Session.query(Status).order_by(desc(Status.time)).offset(PER_PAGE * page).limit(PER_PAGE) return render('/status.mako')
def check(self): status = ("Ok" if is_bueda_up() else "Not Ok") status = Status(status=status) Session.add(status) Session.commit() return status.status
def index(self): # Return a rendered template c.statuses = Session.query(Status).order_by(desc(Status.time)).limit(PER_PAGE) c.page = 1 return render('/status.mako')