[Pulp-dev] Content.serializer class attribute for validation?

Brian Bouterse bmbouter at redhat.com
Tue Feb 18 20:35:35 UTC 2020


tl;dr should content subclasses define a serializer to be used for
validation as a class attribute?

For example FileContent would get:

class FileContent(Content):
    serializer = FileContentSerializer

Then the Stages API when creating content would use that Serializer when
validating the data. This reasoning is that from earlier convo's, Pulp's
codebase is favoring DRF validation with serializers over Django's own
model validation. Because of that I think we need plugin writers to express
how something should validate the model.

We need to know which serializer we need to provide validation of content
creation during sync: https://pulp.plan.io/issues/5927

What do you think?

Thanks!
Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20200218/906e8861/attachment.htm>


More information about the Pulp-dev mailing list