Exemple #1
0
    def get(self, id):
        try:
            user = User.get_by_id(id)
        except AttributeError as e:
            return error(e, 400)
        except ValueError as e:
            return error(e, 404)

        return user.json()
Exemple #2
0
    def new_employee(id, name, gender, tel, level=0) -> "Employee":
        # Test that employee id exists in user table
        user = User.get_by_id(id)

        return Employee(
            id=id,
            name=name,
            gender=gender,
            tel=tel,
            level=level,
            # stat = stat
        )