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

api: record API classes should implement custom get_record for their type #11

Open
slint opened this issue Dec 14, 2020 · 0 comments
Open
Labels
bug Something isn't working

Comments

@slint
Copy link
Member

slint commented Dec 14, 2020

Generated (or default) record API classes for vocabularies that use the common VocabularyMetadata model for storage, should be able to have a more "precise" get_record() method, which makes sure that the correct type of vocabulary is also fetched.

In practice, that means that it shouldn't be possible to call Language.get_record() with a License ID and get a result back

A rough implementation of this was done here: https://github.com/inveniosoftware/invenio-rdm-records/blob/f5b7cbc483f4754ab1e592f492e830bf86fd772d/invenio_rdm_records/records/api.py#L30-L41

@ppanero ppanero added the bug Something isn't working label Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants