django-rest-polymorphic
django-rest-polymorphic copied to clipboard
Allow passing of extra keyword arguments to child classes
I'm currently trying to add https://github.com/rsinger86/drf-flex-fields serializers as children to my Polymorphic Serializers. However they rely on extra keyword arguments being passed in to the children on init. This is something Polymorphic can't really handle right now.
I would like to propose a new keyword argument called child_kwargs
which is a set of kwargs that will be passed to the children along side the normal kwargs.
A PR is on its way for this.
PR made: https://github.com/apirobot/django-rest-polymorphic/pull/34
+1.
Being able to use drf-flex-fields with polymorphic is very much needed.
Useful mention: https://github.com/rsinger86/drf-flex-fields/issues/12#issuecomment-770628228