Beispiel #1
0
def emp_add():
    values = json.loads(request.form['params'])
    try:
        empid = Employee.add(values)
    except Exception as ex:
        return jsonify(error=str(ex))
    return jsonify(empid=empid, employees=Employee.get_all())
    def add_model(self, form_values):
        new_model = Employee(self.get_new_model_values(form_values))

        try:
            new_model.id = new_model.add(Dao())
        except Exception as ex:
            uil.show_error(str(ex))
            return

        uil.show_msg('Employee added!', 'Hallelujah!')