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

SDK: Add organization support to the high-level layer #5718

Merged
merged 7 commits into from
Feb 20, 2023

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Feb 16, 2023

This consists of two parts:

  • API to work with organizations;
  • API to work with other resources in the context of an organization.

Motivation and context

How has this been tested?

SDK unit tests.

Checklist

  • I submit my changes into the develop branch
  • I have added a description of my changes into the CHANGELOG file
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)
  • [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

ModelListMixin[Organization],
ModelRetrieveMixin[Organization],
):
_entity_type = Organization
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably it will be reasonable to add invitations and memberships as well, because it's quite hard to work with orgs without this. I think, just adding the bases with no extra methods is enough for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, fair point. I'll take a look.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out, dealing with invitations is tricky, because they're identified by key instead of ID, which breaks some assumptions in the model mixins. I'll try to solve it, but maybe we can postpone that until the next PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds reasonable.

@SpecLad
Copy link
Contributor Author

SpecLad commented Feb 17, 2023

Note: I renamed current_organization to organization_slug and added a helper context manager.

@nmanovic nmanovic merged commit e816bbf into cvat-ai:develop Feb 20, 2023
@SpecLad SpecLad deleted the sdk-orgs branch March 16, 2023 18:03
@SpecLad SpecLad mentioned this pull request Jun 14, 2023
6 tasks
SpecLad added a commit that referenced this pull request Jun 15, 2023
This is the CLI equivalent of #5718.
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Jul 1, 2023
This consists of two parts:

* API to work with organizations;
* API to work with other resources in the context of an organization.
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

Successfully merging this pull request may close these issues.

3 participants