def render_page(self, page_id): db = self._get_db() page = Page.load(db, "page_%s" % (page_id,)) if not page: c.desired_page_name = page_id return render("new_page.html") c.page = page c.page.page_id = page_id return render("page.html")
def edit(self, **kwargs): db = self._get_db() page_id = kwargs.get("page_id") doc_name = "page_%s" % (page_id,) page = Page.load(db, doc_name) c.page = page return render("edit_page.html")
def index(self): db = self._get_db() c.pages = [p.value for p in db.view("_design/wiki/_view/pages")] return render("pages.html")
def edit_new(self, **kwargs): c.desired_page_name = kwargs.get("page_id") return render("new_page.html")