本文整理汇总了Python中mig_main.models.AcademicTerm.get_rchron_before方法的典型用法代码示例。如果您正苦于以下问题:Python AcademicTerm.get_rchron_before方法的具体用法?Python AcademicTerm.get_rchron_before怎么用?Python AcademicTerm.get_rchron_before使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mig_main.models.AcademicTerm
的用法示例。
在下文中一共展示了AcademicTerm.get_rchron_before方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: leadership_for_term
# 需要导入模块: from mig_main.models import AcademicTerm [as 别名]
# 或者: from mig_main.models.AcademicTerm import get_rchron_before [as 别名]
def leadership_for_term(request, term_id):
"""
Shows the officers for the specified term. The packing logic that assembles
officers into teams for dispaly is contained in the pack_officers_for_term
function.
"""
term = get_object_or_404(AcademicTerm, id=term_id)
officers = pack_officers_for_term(AcademicTerm.objects.get(id=term_id))
officer_set = Officer.objects.filter(term=term).values('id')
template = loader.get_template('about/leadership.html')
context_dict = {
"officers": officers,
'committee_members': CommitteeMember.objects.filter(term=term),
'officer_ids': officer_set,
'request': request,
'terms': AcademicTerm.get_rchron_before()[:5],
'requested_term': term,
'is_current': (term_id == AcademicTerm.get_current_term().id),
'subnav': 'leadership',
}
context_dict.update(get_common_context(request))
context_dict.update(get_permissions(request.user))
context = RequestContext(request, context_dict)
return HttpResponse(template.render(context))