Beispiel #1
0
 def get(self):
     hs = hotel_schema.HotelSchema(many=True)
     filter_hotel = filter_args(path_params)
     try:
         return make_response(paginate(HotelModel, hs, filter_hotel), 200)
     except Exception as e:
         return make_response(
             jsonify({'message': 'internal error server',
                      'error': f'{e}'}),
             500)
Beispiel #2
0
 def get(self):
     res = pagination.paginate(Article, ArticleSchema(many=True), True)
     return res, 200
Beispiel #3
0
 def get(self):
     """Retvrieve malls using pagination"""
     from app import pagination
     return {
         'malls': pagination.paginate(MallModel, MallModel.mall_fields())
     }
Beispiel #4
0
 def get(self):
     """Retrieve all units using pagination."""
     from app import pagination
     return {
         'units': pagination.paginate(UnitModel, UnitModel.unit_fields())
     }
Beispiel #5
0
 def get(self):
     hs = site_schema.SiteSchema(many=True)
     return make_response(pagination.paginate(site_model.SiteModel, hs),
                          200)
Beispiel #6
0
 def get(self):
     """Retrieve all Accounts using pagination."""
     from app import pagination
     return {'accounts': pagination.paginate(AccountModel, AccountModel.account_filed())}
Beispiel #7
0
 def get(self, content_id):
     return pagination.paginate(Content.query.filter_by(id=content_id),
                                Content.marshal_detailed)
Beispiel #8
0
 def get(self):
     return pagination.paginate(Content.query.all(), Content.marshal)