本文整理汇总了Python中models.factory.PosGraduationFactory.students_dao方法的典型用法代码示例。如果您正苦于以下问题:Python PosGraduationFactory.students_dao方法的具体用法?Python PosGraduationFactory.students_dao怎么用?Python PosGraduationFactory.students_dao使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.factory.PosGraduationFactory
的用法示例。
在下文中一共展示了PosGraduationFactory.students_dao方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: view_students
# 需要导入模块: from models.factory import PosGraduationFactory [as 别名]
# 或者: from models.factory.PosGraduationFactory import students_dao [as 别名]
def view_students(initials):
"""Render a view for students list."""
pfactory = PosGraduationFactory(initials)
post_graduation = pfactory.post_graduation
students = pfactory.students_dao()
course_list = {}
coordinators = pfactory.coordinators_dao()
coordinators = list(coordinators.find())
for course in students.keys():
for student in students[course]:
for coordinator in coordinators:
if student['class'] == str(coordinator['registration']):
student['coordinator'] = coordinator['coordinator']
if 'coordinator' not in student.keys():
student['coordinator'] = 'Sem coordenador(a)'
# renders an own page or redirect to another (external/404)?
return render_template(
'public/students.html',
std=get_std_for_template(post_graduation),
students=students
)