本文整理汇总了Python中torlite.model.mpost.MPost.query_cat_recent方法的典型用法代码示例。如果您正苦于以下问题:Python MPost.query_cat_recent方法的具体用法?Python MPost.query_cat_recent怎么用?Python MPost.query_cat_recent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类torlite.model.mpost.MPost
的用法示例。
在下文中一共展示了MPost.query_cat_recent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post_category_recent
# 需要导入模块: from torlite.model.mpost import MPost [as 别名]
# 或者: from torlite.model.mpost.MPost import query_cat_recent [as 别名]
class post_category_recent(tornado.web.UIModule):
def render(self, cat_id, num=10, with_catalog=True, with_date=True):
self.mpost = MPost()
self.mpost2cat = MPost2Catalog()
recs = self.mpost.query_cat_recent(cat_id, num)
kwd = {
'with_catalog': with_catalog,
'with_date': with_date,
}
return self.render_string('{0}/modules/post_list.html'.format(config.torlite_template_name),
recs=recs,
kwd=kwd, )
示例2: post_category_recent
# 需要导入模块: from torlite.model.mpost import MPost [as 别名]
# 或者: from torlite.model.mpost.MPost import query_cat_recent [as 别名]
class post_category_recent(tornado.web.UIModule):
def render(self, cat_id, num=10, with_catalog=True, with_date=True):
self.mpost = MPost()
self.mpost2cat = MPost2Catalog()
# recs = self.mpost2cat.query_by_catid(cat_id)
recs = self.mpost.query_cat_recent(cat_id, num)
kwd = {
'with_catalog': with_catalog,
'with_date': with_date,
}
return self.render_string('tplite/modules/post_list.html',
recs=recs,
kwd=kwd, )
示例3: showout_recent
# 需要导入模块: from torlite.model.mpost import MPost [as 别名]
# 或者: from torlite.model.mpost.MPost import query_cat_recent [as 别名]
class showout_recent(tornado.web.UIModule):
def render(self, cat_id, num=10, with_catalog=True, with_date=True, width=160, height=120):
self.mpost = MPost()
self.mpost2cat = MPost2Catalog()
recs = self.mpost.query_cat_recent(cat_id, num)
kwd = {
'with_catalog': with_catalog,
'with_date': with_date,
'width': width,
'height': height,
}
return self.render_string('{0}/modules/showout_list.html'.format(config.torlite_template_name),
recs=recs,
unescape=tornado.escape.xhtml_unescape,
kwd=kwd, )
示例4: showout_recent
# 需要导入模块: from torlite.model.mpost import MPost [as 别名]
# 或者: from torlite.model.mpost.MPost import query_cat_recent [as 别名]
class showout_recent(tornado.web.UIModule):
def render(self, cat_id, num=10, with_catalog=True, with_date=True, width=160, height=120):
self.mpost = MPost()
self.mpost2cat = MPost2Catalog()
# recs = self.mpost2cat.query_by_catid(cat_id)
recs = self.mpost.query_cat_recent(cat_id, num)
kwd = {
'with_catalog': with_catalog,
'with_date': with_date,
'width': width,
'height': height,
}
return self.render_string('tplite/modules/showout_list.html',
recs=recs,
kwd=kwd, )
示例5: IndexHandler
# 需要导入模块: from torlite.model.mpost import MPost [as 别名]
# 或者: from torlite.model.mpost.MPost import query_cat_recent [as 别名]
class IndexHandler(tornado.web.RequestHandler):
def initialize(self):
self.mpost = MPost()
self.mcat = MCatalog()
def get(self, input=''):
if input == '':
self.index()
else:
self.render('/html/404.html')
def index(self):
dbdata = self.mpost.query_cat_recent(5, 16)
recent = self.mpost.query_recent(8)
self.render('tplite/index/index.html',
view=dbdata,
recent=recent,
unescape=tornado.escape.xhtml_unescape,
format_yr=tools.format_yr)