Ejemplo n.º 1
0
def emp_drop_assignment():
    asn = json.loads(request.form['params'])
    numrows = Assignment.delete(asn['id'])
    assignments = Assignment.get_for_employee(asn['employee_id'])
    return jsonify(
        assignments=assignments
    )
Ejemplo n.º 2
0
def emp_add_assignment():
    values = json.loads(request.form['params'])
    try:
        asnid = Assignment.add(values)
    except Exception as ex:
        return jsonify(error=str(ex))
    assignments = Assignment.get_for_employee(values['employee_id'])
    return jsonify(asnid=asnid, assignments=assignments)
Ejemplo n.º 3
0
def emp_assignments():
    from models.assignment import Assignment
    from models.month import Month

    empid = int(request.args['empid'])
    month = Month.today()
    data = Assignment.get_for_employee(empid, month)
    return jsonify(assignments=data)