当前位置: 首页>>代码示例>>Python>>正文


Python PosGraduationFactory.classes_dao方法代码示例

本文整理汇总了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
    )
开发者ID:Mazuh,项目名称:OAuth2Client-PHP-APIsistemas-PPGP,代码行数:32,代码来源:public.py

示例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
    )
开发者ID:Mazuh,项目名称:OAuth2Client-PHP-APIsistemas-PPGP,代码行数:13,代码来源:public.py

示例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.'
        )
    )
开发者ID:Mazuh,项目名称:OAuth2Client-PHP-APIsistemas-PPGP,代码行数:22,代码来源:crud_classes.py


注:本文中的models.factory.PosGraduationFactory.classes_dao方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。