Project

Profile

Help

Issue #1509

closed

Documents should have a serializer by default

Added by semyers about 8 years ago. Updated almost 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

All Documents should probably have a serializer, so we don't have to constantly check if our models have serializers before using them.

ModelSerializer[0] appears to have a reasonable default behavior for mongoengine models (which makes sense), so AutoRetryDocument[1] should probably use that as its SERIALIZER attribute. Once that's done, we can remove a bunch of hasattr(model, 'SERIALIZER') checks because we've ensured that the model does, in fact, hasattr.

[0]: https://github.com/pulp/pulp/blob/d46a334f745697604125825c827d29dca6c97970/server/pulp/server/webservices/views/serializers/__init__.py#L158
[1]: https://github.com/pulp/pulp/blob/d46a334f745697604125825c827d29dca6c97970/server/pulp/server/db/model/__init__.py#L38

Also available in: Atom PDF