Issue #3587
closedMultiple serializers doesn't work for detail viewsets types
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.
Updated by amacdona@redhat.com over 6 years ago
dalley, so we need to move the get_serializer_class override out of the base class and into the TaskSerializer?
Updated by amacdona@redhat.com over 6 years ago
also, what specific errors does this cause?
Updated by amacdona@redhat.com over 6 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 36
Updated by dalley over 6 years ago
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.
Updated by dalley over 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
Updated by dalley over 6 years ago
- Status changed from ASSIGNED to POST
Updated by dalley over 6 years ago
- Status changed from POST to ASSIGNED
Issues with this approach, moving out of POST until it can be figured out
Added by dalley over 6 years ago
Added by dalley over 6 years ago
Revision 4587e0ed | View on GitHub
Fixes using multiple serializers on derived viewsets
Updated by dalley over 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|4587e0ed6cd77466a7ea45c97aad407d4ba04c08.
Updated by bmbouter about 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Fixes using multiple serializers on derived viewsets
closes #3587 https://pulp.plan.io/issues/3587