本文整理汇总了Python中models.card.Card.get_all_card方法的典型用法代码示例。如果您正苦于以下问题:Python Card.get_all_card方法的具体用法?Python Card.get_all_card怎么用?Python Card.get_all_card使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.card.Card
的用法示例。
在下文中一共展示了Card.get_all_card方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models.card import Card [as 别名]
# 或者: from models.card.Card import get_all_card [as 别名]
def get(self):
uname = self.get_current_user()
user = User.get_user_by_name(uname)
order = get_order()
card = Card.get_by_porder(order)
cid = self.get_argument("cid",None)
if cid is not None:
card=Card.get_by_cid(cid)
article = Article.get_all_Acard(200)
usedCard = Card.get_all_card()
temp = []
for one in usedCard:
if 0 < one.porder and one.porder <= order:
temp.append(one)
usedCard = temp
reArticles = Article.get_all(200)
Rarticle = sorted(reArticles,BaseHandler.rank)
if len(Rarticle) > 6:
Rarticle = Rarticle[:6]
Ruser = User.get_all_user(100)
if len(Ruser)>9:
Ruser = Ruser[:9]
if len(usedCard)>3:
usedCard = usedCard[:3]
self.render("card.html",user=user,Rarticle=Rarticle,Article=article,usedCard=usedCard,Ruser=Ruser,card=card)
示例2: get
# 需要导入模块: from models.card import Card [as 别名]
# 或者: from models.card.Card import get_all_card [as 别名]
def get(self):
root = self.get_secure_cookie('root')
if root=='suiyue':
current_order = get_order()
cards = Card.get_all_card()
stories = Story.get_all_story()
self.render("control.html", order=current_order, cards=cards, stories=stories)
else:
self.redirect('/rootlogin')