Open multimeric opened 4 years ago
Allows users to provide fields like get_schema_kwargs as functions instead of dictionaries. These functions have access to the view's args and kwargs.
get_schema_kwargs
For example:
class PersonDetail(ResourceDetail): schema = person_schema data_layer = { 'model': person_model, 'session': session, 'url_field': 'person_id' } def get_schema_kwargs(self, args, kwargs): return dict( exclude=['name'] )
You can still use the simpler method of providing a dictionary, too.
I've added two tests for these two use-cases.
Coverage decreased (-0.06%) to 90.709% when pulling 53886869811fce7cc1713f42b7142dfec148048e on TMiguelT:get_schema_kwargs into b44bc08b11213d49fadae873650d3555889052ec on miLibris:master.
Allows users to provide fields like
get_schema_kwargs
as functions instead of dictionaries. These functions have access to the view's args and kwargs.For example:
You can still use the simpler method of providing a dictionary, too.
I've added two tests for these two use-cases.