本文整理汇总了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())
示例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)
示例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())
示例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
)
示例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
)