def get_all_users(self): dao = UserDAO() result = dao.get_all_users() mapped_result = [] for r in result: mapped_result.append(self.map_to_dict(r)) return jsonify(Part=mapped_result)
def get_user_by_password(self, password): dao = UserDAO() result = dao.get_user_by_password(password) if result is None: return jsonify(Error="NOT FOUND"), 404 else: mapped = self.map_to_dict(result) return jsonify(Part=mapped)
def get_user_by_email(self, uemail): dao = UserDAO() result = dao.get_user_by_email(uemail) if result is None: return jsonify(Error="NOT FOUND"), 404 else: mapped = self.map_to_dict(result) return jsonify(Part=mapped)
def get_user_by_id(self, id): dao = UserDAO() result = dao.get_user_by_uid(id) if result == None: return jsonify(Error="NOT FOUND"), 404 else: mapped = self.map_to_dict(result) return jsonify(Part=mapped)
def get_user_by_lname(self, user_lname): dao = UserDAO() result = dao.get_user_by_lname(user_lname) mapped_result = [] for r in result: mapped_result.append(self.map_to_dict(r)) return jsonify(Part=mapped_result)