本文整理汇总了Python中models.Issue.issues_voted_on方法的典型用法代码示例。如果您正苦于以下问题:Python Issue.issues_voted_on方法的具体用法?Python Issue.issues_voted_on怎么用?Python Issue.issues_voted_on使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Issue
的用法示例。
在下文中一共展示了Issue.issues_voted_on方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models import Issue [as 别名]
# 或者: from models.Issue import issues_voted_on [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()))