Story #5539
Updated by bmbouter over 4 years ago
h3. Problem Say a single Artifact will generate multiple Content units, and the plugin writer is using SingleArtifactContentUploadViewSet which will use "general_create":https://github.com/pulp/pulpcore/blob/d545ecb091c5fb8003fbe2cb87bdeb988bb33bcd/pulpcore/app/tasks/base.py#L5 The serializer will create multiple content objects successfull, but at "this line":https://github.com/pulp/pulpcore/blob/d545ecb091c5fb8003fbe2cb87bdeb988bb33bcd/pulpcore/app/tasks/base.py#L20 h3. Solution Option 1: Update general_create() to handle both the single created resource and the multi-created resource cases. Option 2: Move the CreatedResource part out of general_create() and into a Serializer and have general_create call it. Perhaps it would be called <code>save_created_resources</code>. This would allow a default implementation to handle the single case, and multi-resource workflows would override their serializers to create more CreateResource objects then Option 3: Have the CreateResource records created in the Serializer.create() itself. This is a variation of Option 2, only with without a separate interface. ???