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

Corpus validation after all fields are added #1333

Closed
lukavdplas opened this issue Nov 24, 2023 · 0 comments · Fixed by #1504
Closed

Corpus validation after all fields are added #1333

lukavdplas opened this issue Nov 24, 2023 · 0 comments · Fixed by #1504
Assignees
Labels
backend changes to the django backend corpus changes to corpus definitions or new corpora enhancement improvements to user functionality

Comments

@lukavdplas
Copy link
Contributor

Is your feature request related to a problem? Please describe.
We recently added a LOT of validation for corpora, which is nice. But some requirements for fields can't be validated because you need to be sure all fields have been added. For example, this docstring suggests that there must be an 'id' field ,but that is never enforced:

https://github.com/UUDigitalHumanitieslab/I-analyzer/blob/9224528af4a435b84d8708fdad422eb8f2980ac9/backend/addcorpus/corpus.py#L109

There are some similar requirements, like how each corpus should at least have one text_content field.

We can't validate this at the moment, because you need to save the CorpusConfiguration in the databse before you can add fields to it. You also can't add this to field validation, because fields are saved one by one.

This also applies to #982 - a user should be able to save their "working version" of a corpus before they have added every single field.

Describe the solution you'd like
Perhaps we can add a second validation method that isn't run when saving the model, but is run when you want to index the corpus or include it in the interface. So you can save a corpus without an ID field, but I-analyzer will consider it a draft and refuse to include it in the interface.

@lukavdplas lukavdplas added enhancement improvements to user functionality backend changes to the django backend corpus changes to corpus definitions or new corpora labels Nov 24, 2023
@lukavdplas lukavdplas self-assigned this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend changes to the django backend corpus changes to corpus definitions or new corpora enhancement improvements to user functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant