本文整理匯總了Python中models.card.Card.get_by_porder方法的典型用法代碼示例。如果您正苦於以下問題:Python Card.get_by_porder方法的具體用法?Python Card.get_by_porder怎麽用?Python Card.get_by_porder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.card.Card
的用法示例。
在下文中一共展示了Card.get_by_porder方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get
# 需要導入模塊: from models.card import Card [as 別名]
# 或者: from models.card.Card import get_by_porder [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: post
# 需要導入模塊: from models.card import Card [as 別名]
# 或者: from models.card.Card import get_by_porder [as 別名]
def post(self):
cid = self.get_argument('cid')
porder = self.get_argument('porder')
root = self.get_secure_cookie('root')
if root == 'suiyue':
temp = Card.get_by_porder(porder)
if len(temp) > 0:
Card.change_porder(temp[0].cid, 0)
Card.change_porder(cid, porder)
self.redirect('/control')
else:
self.redirect('/rootlogin')