def getPostByGroupIdDETAILED(self, gID): dao = PostDAO() result = dao.getPostsByGroupID(gID) mapped_result = [] for r in result: mapped_result.append( mapPostToDictDETAILED(r, self.getRepliesByPostIDDETAILED(r[0]))) return jsonify(mapped_result)
def getPostByGroupId(self, gID): dao = PostDAO() result = dao.getPostsByGroupID(gID) if not result: return jsonify(Error="Not found"), 404 mapped_result = [] for r in result: mapped_result.append(mapPostToDict(r)) return jsonify(mapped_result)