本文整理匯總了Python中models.Box.all方法的典型用法代碼示例。如果您正苦於以下問題:Python Box.all方法的具體用法?Python Box.all怎麽用?Python Box.all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Box
的用法示例。
在下文中一共展示了Box.all方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: render_page
# 需要導入模塊: from models import Box [as 別名]
# 或者: from models.Box import all [as 別名]
def render_page(self, errors=None):
''' Addes extra params to render() '''
user = self.get_current_user()
boxes = filter(lambda box: box.source_code is not None, Box.all())
self.render('upgrades/source_code_market.html',
user=user, boxes=boxes, errors=errors
)
示例2: scoring_round
# 需要導入模塊: from models import Box [as 別名]
# 或者: from models.Box import all [as 別名]
def scoring_round():
'''
Executed as a periodic callback for main io_loop: Iterates of all the boxes
and scores each box.
'''
boxes = list(Box.all())
logging.info("Starting scoring round with %d boxes" % len(boxes))
for box in boxes:
score_box(box)
logging.info("Scoring round completed")