Example #1
0
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
Example #2
0
 def likes(self):
     from models.relation_like import LikeRelation
     return User.select().join(
         LikeRelation,
         pw.JOIN.LEFT_OUTER).where(LikeRelation.recipe == self)