def get_users(): query = User.select() users = [c for c in query] user_dicts = [c.as_dict() for c in users] return flask.jsonify({'msg': 'Success', 'data': user_dicts}), 200
def likes(self): from models.relation_like import LikeRelation return User.select().join( LikeRelation, pw.JOIN.LEFT_OUTER).where(LikeRelation.recipe == self)