本文整理汇总了Python中models.factory.PosGraduationFactory.classes_dao方法的典型用法代码示例。如果您正苦于以下问题:Python PosGraduationFactory.classes_dao方法的具体用法?Python PosGraduationFactory.classes_dao怎么用?Python PosGraduationFactory.classes_dao使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.factory.PosGraduationFactory
的用法示例。
在下文中一共展示了PosGraduationFactory.classes_dao方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: view_classes
# 需要导入模块: from models.factory import PosGraduationFactory [as 别名]
# 或者: from models.factory.PosGraduationFactory import classes_dao [as 别名]
def view_classes(initials):
"""Render a view for classes list."""
form = FindClass()
pfactory = PosGraduationFactory(initials)
post_graduation = pfactory.post_graduation
now = datetime.datetime.now()
if now.month <= 7:
semester = 1
else:
semester = 2
classes=pfactory.classes_dao(now.year,semester,100).find()
if form.validate_on_submit():
return redirect(
url_for(
'public.find_classes',
initials=initials,
year=form.year.data,
period=form.period.data
)
)
# renders an own page or redirect to another (external/404)?
return render_template(
'public/subjectsinclasses.html',
std=get_std_for_template(post_graduation),
form=form,
classes=classes
)
示例2: find_classes
# 需要导入模块: from models.factory import PosGraduationFactory [as 别名]
# 或者: from models.factory.PosGraduationFactory import classes_dao [as 别名]
def find_classes():
form = FindClass()
pfactory = PosGraduationFactory(request.args['initials'])
post_graduation = pfactory.post_graduation
classes_2 =pfactory.classes_dao(request.args['year'], request.args['period'], 100).find()
return render_template(
'public/subjectsinclasses.html',
std=get_std_for_template(post_graduation),
form=form,
classes=classes_2
)
示例3: add_first_class
# 需要导入模块: from models.factory import PosGraduationFactory [as 别名]
# 或者: from models.factory.PosGraduationFactory import classes_dao [as 别名]
def add_first_class():
pfactory = PosGraduationFactory(current_user.pg_initials)
dao = pfactory.classes_database_dao()
now = datetime.datetime.now()
if now.month <= 7:
semester = 1
else:
semester = 2
classes=pfactory.classes_dao(now.year,semester,100).find()
dao.find_one_and_update(None, {
'$set': { 'firstClasses': classes}
})
return redirect(
url_for(
'admin.index',
success_msg='Primeiras turmas modificadas com sucesso.'
)
)