Issue #4394
closedContent serializer validate should ensure a saveable object
Description
This may be up for discussion:
In the current state, the content serializer family can validate content objects containing artifacts, but when valid, the user is supposed to pop off the `_artifact{,s}` field and create the `ContentArtifact` entities on his own.
I think, if the serializer said, an object is valid, a subsequent `save` without further parameters should just work.
In my approach, i tried to follow the example in [0]. This has the nice side-effect, that the plugin writer is not anymore concerned with handling the `ContentArtifacts` at all.
Related issues
Updated by amacdona@redhat.com almost 6 years ago
- Status changed from NEW to POST
- Assignee set to mdellweg
Added by mdellweg almost 6 years ago
Added by mdellweg almost 6 years ago
Revision d3fbf868 | View on GitHub
Save ContentArtifacts in ContentSerializer
Required PR: https://github.com/pulp/pulpcore-plugin/pull/65 Required PR: https://github.com/pulp/pulp_file/pull/166
Updated by daviddavis almost 6 years ago
- Status changed from POST to MODIFIED
Solution was to move content artifact creation into the create
method of serializers. There's a relative_path field now on SingleArtifactContentSerializer
which plugins can set in the validate
method. See pulp_file as an example:
Updated by daviddavis over 5 years ago
- Related to Issue #4472: Relative_path error when uploading a file added
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Save ContentArtifacts in ContentSerializer
Required PR: https://github.com/pulp/pulpcore-plugin/pull/65 Required PR: https://github.com/pulp/pulp_file/pull/166
re #4394 https://pulp.plan.io/issues/4394