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


Python Project.get_all方法代码示例

本文整理汇总了Python中models.project.Project.get_all方法的典型用法代码示例。如果您正苦于以下问题:Python Project.get_all方法的具体用法?Python Project.get_all怎么用?Python Project.get_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.project.Project的用法示例。


在下文中一共展示了Project.get_all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: prj_add

# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import get_all [as 别名]
def prj_add():
    values = json.loads(request.form['params'])
    try:
        prjid = Project.add(values)
    except Exception as ex:
        return jsonify(error=str(ex))
    return jsonify(prjid=prjid, projects=Project.get_all())
开发者ID:joegillon,项目名称:allocat,代码行数:9,代码来源:projects.py

示例2: prj_drop

# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import get_all [as 别名]
def prj_drop():
    prjid = json.loads(request.args['prjid'])
    success = Project.delete(prjid)
    if not success:
        msg = 'Record not deleted for unknown reason. Contact admin.'
        return jsonify(error=msg)
    data = Project.get_all()
    return jsonify(projects=data)
开发者ID:joegillon,项目名称:allocat,代码行数:10,代码来源:projects.py

示例3: prj_update

# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import get_all [as 别名]
def prj_update():
    values = json.loads(request.form['params'])
    prjid = values['id']
    try:
        numrows = Project.update(values)
        if numrows != 1:
            msg = 'Record not updated for unknown reason. Contact admin.'
            return jsonify(error=msg)
    except Exception as ex:
        return jsonify(error=str(ex))
    return jsonify(prjid=prjid, projects=Project.get_all())
开发者ID:joegillon,项目名称:allocat,代码行数:13,代码来源:projects.py

示例4: prj_list

# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import get_all [as 别名]
def prj_list():
    projects = Project.get_all()
    emp_rex = Employee.get_all()
    employees = [{'id': employee['id'], 'value': employee['name']} for employee in emp_rex]

    is_authenticated = session['is_authenticated'] if 'is_authenticated' in session else False
    page = 'projects.html' if is_authenticated else 'projects_ro.html'

    return render_template(
        page,
        title='allocat projects',
        projects=projects,
        employees=employees
    )
开发者ID:joegillon,项目名称:allocat,代码行数:16,代码来源:projects.py

示例5: emp_list

# 需要导入模块: from models.project import Project [as 别名]
# 或者: from models.project.Project import get_all [as 别名]
def emp_list():
    employees = Employee.get_all()
    prj_rex = Project.get_all()
    projects = [
        {
            'id': project['id'],
            'value': project['nickname'],
            'first_month': project['first_month'],
            'last_month': project['last_month']
        } for project in prj_rex]

    is_authenticated = session['is_authenticated'] if 'is_authenticated' in session else False
    page = 'employees.html' if is_authenticated else 'employees_ro.html'

    return render_template(
        page,
        title='allocat employees',
        projects=projects,
        employees=employees
    )
开发者ID:joegillon,项目名称:allocat,代码行数:22,代码来源:employees.py


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