Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Issue #533: Implement API get_vocabulary & get_vocabularies_name #557
Issue #533: Implement API get_vocabulary & get_vocabularies_name #557
Changes from 3 commits
ec67622
b24a7fc
df5429c
15441eb
1ade6d8
0a4e42d
ccfe146
3392922
3078ab3
98b5024
caf9226
f07420b
d806295
91bd500
4685693
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for your contribution!
It might be interesting to have an error message consistent with the one raised by the
get_view
function:plone.api/src/plone/api/content.py
Lines 534 to 554 in c9a35d7
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Making the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about:
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace these lines with a
self.assertIsInstance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you suggest importing

collections.abc
just to replace current approach?i can try going with this
but i'm not sure if vocabularies with length 0 are to be supported or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, sorry. I was referring to something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test on context sensitivity would need a vocabulary that is context sensitive to be meaningful.
I would say this test is not really needed, as the new plone.api method
api.content.get_vocabulary
is simply callinggetUtility(IVocabularyFactory, name)
and applying this vocabulary to the context. So the underlying code is testing the context sensitivity already.Further opinions are welcome.