Issue #3587
closed
Multiple serializers doesn't work for detail viewsets types
Status:
CLOSED - CURRENTRELEASE
Description
In the "NamedModelViewSet", we overrode "get_serializer_class()" so that derivative viewsets like TaskViewSet can define different serializers for different actions. This works for Task, but it does not work for viewsets derived from other viewsets.
For instance, it is non-functional on PythonPackageContentViewSet, which inherits from ContentViewSet, which inherits from NamedModelViewSet.
dalley, so we need to move the get_serializer_class override out of the base class and into the TaskSerializer?
also, what specific errors does this cause?
- Triaged changed from No to Yes
- Sprint set to Sprint 36
There were no errors, but the multiple serializers part did not work for me. It just used the "default" serializer class for everything. Not fully sure why or how best to solve it since I didn't dig too deep at the time.
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
- Status changed from ASSIGNED to POST
- Sprint changed from Sprint 36 to Sprint 37
- Status changed from POST to ASSIGNED
Issues with this approach, moving out of POST until it can be figured out
- Status changed from ASSIGNED to POST
- Status changed from POST to MODIFIED
- Sprint/Milestone set to 3.0.0
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Fixes using multiple serializers on derived viewsets
closes #3587 https://pulp.plan.io/issues/3587