Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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)