def getAllPersons(self): dao = PersonDAO() persons = [] items = dao.getAllPersons() for i in items: result = self.build_Person_dict(i) persons.append(result) return jsonify(Person=persons)
def getAllPersons(self): dao = PersonDAO() result = dao.getAllPersons() if not result: dao.closeDB() return jsonify(Error="Person NOT FOUND"), 404 mapped_result = [] for r in result: mapped_result.append(mapPersonToDict(r)) dao.closeDB() return jsonify(Person=mapped_result)
def getAllPersons(self): dao = PersonDAO() person_list = dao.getAllPersons() return jsonify(person_list), 200