本文整理匯總了Python中models.Issue.recent_results方法的典型用法代碼示例。如果您正苦於以下問題:Python Issue.recent_results方法的具體用法?Python Issue.recent_results怎麽用?Python Issue.recent_results使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類models.Issue
的用法示例。
在下文中一共展示了Issue.recent_results方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get
# 需要導入模塊: from models import Issue [as 別名]
# 或者: from models.Issue import recent_results [as 別名]
def get(self):
user = users.get_current_user()
if user:
logout_url = users.create_logout_url('/')
else:
login_url = users.create_login_url('/')
issues = Issue.all().order('creation_date').fetch(30)
success_type = self.request.get('success')
success_msg = None
if success_type == 'vote':
success_msg = 'Your vote was successfully cast!'
if success_type == 'updated':
success_msg = 'Your vote was successfully updated!'
created_by = Issue.issues_created_by(member=user,limit=20)
voted_on = Issue.issues_voted_on(member=user,limit=20)
#recent_results = [issue for issue in voted_on if issue.has_results]
recent_voted = [issue for issue in voted_on if issue.is_active()]
recent_results = Issue.recent_results(limit=20)
self.response.out.write(template.render('templates/overview.html', locals()))