示例#1
0
    def get(self, _id=None):
        if _id:
            user = UserModel.find_by_id(_id)

            if not user:
                return {'message': 'no results'}, 204
            return user.json(), 200

        users = UserModel.all()

        if not users:
            return {'message': 'no results'}, 204
        return [user.json() for user in users], 200
示例#2
0
 def read_all(self):
     """
     ユーザーデータを全て取得する
     """
     users = UserModel.all()
     return users