本文整理汇总了Python中issues.models.Issue.filter_by_kinds方法的典型用法代码示例。如果您正苦于以下问题:Python Issue.filter_by_kinds方法的具体用法?Python Issue.filter_by_kinds怎么用?Python Issue.filter_by_kinds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类issues.models.Issue
的用法示例。
在下文中一共展示了Issue.filter_by_kinds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: index
# 需要导入模块: from issues.models import Issue [as 别名]
# 或者: from issues.models.Issue import filter_by_kinds [as 别名]
def index(request, show=None):
issues = None
if show:
kind_filter = index_filters.get(show, None)
if kind_filter is None:
return HttpResponseNotFound()
issues = Issue.filter_by_kinds(kind_filter).filter(public=True).all()
else:
return render_to_response('issues/welcome.html', context_instance=RequestContext(request))
issues = map(Issue.get_typed, issues)
random.shuffle(issues)
if show == 'grad':
newissues = list()
for i in issues:
if i.kind == oe_constants.ISSUE_SPECFEE and i.is_grad_issue() == False:
continue
newissues.append(i)
issues = newissues
return render_to_response('issues/index.html', {'issues': issues, 'detail': False}, context_instance=RequestContext(request))