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

Merge get_xxx and get_all_xxx methods #5

Open
hbredin opened this issue Dec 18, 2014 · 1 comment
Open

Merge get_xxx and get_all_xxx methods #5

hbredin opened this issue Dec 18, 2014 · 1 comment

Comments

@hbredin
Copy link
Member

hbredin commented Dec 18, 2014

I think it would simplify the client (from user perspective) to merge get_xxx and get_all_xxx methods (where xxx can be user, group, corpus, etc...)

Example for user methods

def get_user(self, user_id=None):
    route = 'user'
    if user_id is not None:
        route = route + '/' + user_id
    return self.get(route)

@juandelamontana @clbarras what do you think?

@johannpoignant
Copy link

Yes I think we could also simplified these routes :

get_user(id_user=<id_user>) -> return one user
get_user() -> return a list of users
idem for other resources

get_all_media_of_a_corpus -> get_media(id_corpus = <id_corpus>)
get_media -> get_media(id_media = <id_media>)
idem for layer and annotation

get_ACL_of_a_corpus -> get_corpus(id_corpus = <id_corpus>)
return ACL if the user is the OWNER of the ressource

update_user_ACL_of_a_corpus -> update_ACL_of_a_corpus(id_corpus = <id_corpus>, id_user = <id_user>)
idem for corpus/group, layer/user and layer/group

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

No branches or pull requests

2 participants