Project

Profile

Help

Issue #3587

Multiple serializers doesn't work for detail viewsets types

Added by dalley about 2 years ago. Updated 6 months ago.

Status:
CLOSED - CURRENTRELEASE
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 about 2 years ago

Fixes using multiple serializers on derived viewsets

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

Revision 4587e0ed View on GitHub
Added by dalley about 2 years ago

Fixes using multiple serializers on derived viewsets

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

History

#1 Updated by amacdona@redhat.com about 2 years 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 about 2 years ago

also, what specific errors does this cause?

#3 Updated by amacdona@redhat.com about 2 years ago

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

#4 Updated by dalley about 2 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.

#5 Updated by dalley about 2 years ago

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

#6 Updated by dalley about 2 years ago

  • Status changed from ASSIGNED to POST

#7 Updated by rchan about 2 years ago

  • Sprint changed from Sprint 36 to Sprint 37

#8 Updated by dalley about 2 years 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 about 2 years ago

  • Status changed from ASSIGNED to POST

#10 Updated by dalley almost 2 years ago

  • Status changed from POST to MODIFIED

#11 Updated by daviddavis about 1 year ago

  • Sprint/Milestone set to 3.0.0

#12 Updated by bmbouter about 1 year ago

  • Tags deleted (Pulp 3)

#13 Updated by bmbouter 6 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF