def show(self, *args, **kwargs): u"""メモの詳細を表示します。""" id = kwargs["id"] model = ArticleModel.get_by_id(id) article = ArticleModel.getArticle(model) alert = dict(getFlashedMessage(withCategory=True)) return self.renderTemplate("index/show.html", article=article, alert=alert)
def show(self, *args, **kwargs): u"""メモの詳細を表示します。""" id = kwargs['id'] model = ArticleModel.get_by_id(id) article = ArticleModel.getArticle(model) alert = dict(getFlashedMessage(withCategory=True)) return self.renderTemplate('index/show.html', article=article, alert=alert)
def edit(self, *args, **kwargs): u"""メモを編集します。""" alert = dict(getFlashedMessage(withCategory=True)) id = kwargs["id"] model = ArticleModel.get_by_id(id) form = self.renderTemplate("index/form.html", action="/" + str(id), method="PUT") defaults = {"title": model.title, "text": model.text, "tags": ",".join([tag.tagname for tag in model.tags])} form = htmlfill.render(form, defaults) return self.renderTemplate("index/edit.html", form=form, alert=alert)
def index(self, *args, **kwargs): u"""メモを一覧で表示します。""" page = kwargs["page"] if "page" in kwargs else 1 count = SystemInfoModel.getArticleCount() articles = ArticleModel.getArticleForPage(page, PER_PAGE) pagination = Pagination(page, PER_PAGE, count) alert = dict(getFlashedMessage(withCategory=True)) return self.renderTemplate( "index/index.html", articles=articles, pagination=pagination, pagePath="/page/", alert=alert )
def index(self, *args, **kwargs): u"""メモを一覧で表示します。""" page = kwargs['page'] if 'page' in kwargs else 1 count = SystemInfoModel.getArticleCount() articles = ArticleModel.getArticleForPage(page, PER_PAGE) pagination = Pagination(page, PER_PAGE, count) alert = dict(getFlashedMessage(withCategory=True)) return self.renderTemplate('index/index.html', articles=articles, pagination=pagination, pagePath='/page/', alert=alert)
def edit(self, *args, **kwargs): u"""メモを編集します。""" alert = dict(getFlashedMessage(withCategory=True)) id = kwargs['id'] model = ArticleModel.get_by_id(id) form = self.renderTemplate('index/form.html', action='/' + str(id), method='PUT') defaults = { 'title': model.title, 'text': model.text, 'tags': ','.join([tag.tagname for tag in model.tags]) } form = htmlfill.render(form, defaults) return self.renderTemplate('index/edit.html', form=form, alert=alert)
def getFlashedMessages(*args,**kwargs): return getFlashedMessage(*args,**kwargs)