- Don't catch
AttributeErrorandKeyErrorforMethodField
Unclaimed project
Are you a maintainer of serpy? Claim this project to take control of your public changelog and roadmap.
AttributeError and KeyError for MethodField| | required=True | required=False |
| --- | --- | --- |
| data = {'value': 1} | {'value': 1} | {'value': 1} |
| data = {'value': None} | {'value': None} | {'value': None} |
| data = {} | KeyError('value',) | {} |
required=False, None values will now be dropped from the outputMethodFields with required=True will trigger an exception when None value is returnedlabel parameter to Field to be able to specify the output labelAPI changes:
obj to instanceSerializer now takes context kwarg and ignores it for Django REST Framework compatSerializer now takes data kwarg and errors for Django REST Framework compat