Project

Profile

Help

Issue #3587

Multiple serializers doesn't work for detail viewsets types

Added by dalley over 1 year ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 37

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.

Associated revisions

Revision 4587e0ed View on GitHub
Added by dalley over 1 year ago

Fixes using multiple serializers on derived viewsets

closes #3587
https://pulp.plan.io/issues/3587

Revision 4587e0ed View on GitHub
Added by dalley over 1 year ago

Fixes using multiple serializers on derived viewsets

closes #3587
https://pulp.plan.io/issues/3587

Revision 4587e0ed View on GitHub
Added by dalley over 1 year ago

Fixes using multiple serializers on derived viewsets

closes #3587
https://pulp.plan.io/issues/3587

History

#1 Updated by amacdona@redhat.com over 1 year ago

@dalley, so we need to move the get_serializer_class override out of the base class and into the TaskSerializer?

#2 Updated by amacdona@redhat.com over 1 year ago

also, what specific errors does this cause?

#3 Updated by amacdona@redhat.com over 1 year ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 36

#4 Updated by dalley over 1 year 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.

#5 Updated by dalley over 1 year ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley

#6 Updated by dalley over 1 year ago

  • Status changed from ASSIGNED to POST

#7 Updated by rchan over 1 year ago

  • Sprint changed from Sprint 36 to Sprint 37

#8 Updated by dalley over 1 year ago

  • Status changed from POST to ASSIGNED

Issues with this approach, moving out of POST until it can be figured out

#9 Updated by dalley over 1 year ago

  • Status changed from ASSIGNED to POST

#10 Updated by dalley over 1 year ago

  • Status changed from POST to MODIFIED

#11 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#12 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF