Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable re-using non-image files for jobs, archive items and display sets through the API #3576

Open
amickan opened this issue Oct 7, 2024 · 0 comments

Comments

@amickan
Copy link
Contributor

amickan commented Oct 7, 2024

When creating or updating archive items, display sets and algorithm jobs through the API, users can currently only upload new files for file type interfaces. In the UI they get the option to select a previously uploaded file instead. This should also work through the API.

Since we don't have a File model (like we do for images, see Image model), the only way to refer to existing files is through the CIV that they are attached to. The relevant serializers for this (JobPostSerializer, DisplaySetPostSerializer and ArchiveItemPostSerializer) currently expect CIV data to be input in the format of ComponentInterfaceValuePostSerializer, which does not allow to specify an existing CIV. This needs to change. The way I currently think this should be done is by updating the JobPostSerializer (and the other two) and to conditionally use either ComponentInterfaceValuePostSerializer or HyperlinkedComponentInterfaceValueSerializer to parse the data in inputs.

Finally, the helper functions in gcapi need to be updated as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant