本文整理汇总了Python中article.Article.a方法的典型用法代码示例。如果您正苦于以下问题:Python Article.a方法的具体用法?Python Article.a怎么用?Python Article.a使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类article.Article
的用法示例。
在下文中一共展示了Article.a方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from article import Article [as 别名]
# 或者: from article.Article import a [as 别名]
def __init__(self, app):
bmodel = BlogModel()
bview = BlogFeedView()
form = Form()
art = Article()
if app.request.GET:
# On submit of the form. The info is stored in the self.the_posted object
self.the_post = {}
self.the_post["title"] = app.request.GET["title"]
self.the_post["author"] = app.request.GET["author"]
self.the_post["tags"] = app.request.GET["tags"]
self.the_post["category"] = app.request.GET["category"]
self.the_post["article"] = app.request.GET["article"]
self.the_post["date"] = (time.strftime("%m/%d/%Y"))
# Pass the post object into the format method art.a() to return a string html.
# Then add the the global log_post array to the add_post_list so that the post will be append to it.
bmodel.add_post_list(art.a(self.the_post), log_posts)
# This will then write the response to the browser after the full html document is returned.
app.response.write(bview.form_success(bmodel.formator(log_posts), form.reg_form))
else:
# If no submission display form only to the browser.
app.response.write(bview.print_out_form(form.reg_form))