While lazily evaluating the expanded serializer class from a string caters for avoiding circular imports, I need a way to evaluate the class from a function.
I'm using this package together with django-oscar-api which provides it's own helper function (get_api_class) for dynamically loading classes so as to allow overriding the default serializers. As such, I would like to be able to define an expandable field like this:
I imagine this could provide a lot more flexibility allowing executing some logic to determine the serializer class (or import path), even outside of django-oscar-api
I did some customizing here to get this working and would be happy to open a PR if you're willing to support this in this package
While lazily evaluating the expanded serializer class from a string caters for avoiding circular imports, I need a way to evaluate the class from a function.
I'm using this package together with django-oscar-api which provides it's own helper function (
get_api_class
) for dynamically loading classes so as to allow overriding the default serializers. As such, I would like to be able to define an expandable field like this:I imagine this could provide a lot more flexibility allowing executing some logic to determine the serializer class (or import path), even outside of django-oscar-api
I did some customizing here to get this working and would be happy to open a PR if you're willing to support this in this package