class ConcreteResource(BaseResource): kwargs = GenreSchema @use_kwargs(Ref('kwargs'), location='querystring') @marshal_with(schemas.BandSchema) def get(self, **kwargs): return kwargs
class ConcreteResource(BaseResource): kwargs = {'genre': fields.Str()} @use_kwargs(Ref('kwargs')) @marshal_with(schemas.BandSchema) def get(self, **kwargs): return kwargs
class AggregateResource(ApiResource): schema = None query_args = {} @property def sort_args(self): return args.make_sort_args(validator=args.IndexValidator(self.model)) @use_kwargs(args.paging) @use_kwargs(Ref('sort_args')) @use_kwargs(Ref('query_args')) @marshal_with(Ref('schema')) def get(self, committee_id=None, **kwargs): return super().get(committee_id=committee_id, **kwargs) def build_query(self, committee_id, **kwargs): query = super().build_query(**kwargs) if committee_id is not None: query = query.filter(self.model.committee_id == committee_id) return query
class BaseResource(MethodResource): schema = None @marshal_with(Ref('schema')) def get(self): pass