-
Notifications
You must be signed in to change notification settings - Fork 206
SG-10151: set field visibility via API #209
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
Conversation
| ] | ||
| } | ||
|
|
||
| params = self._add_project_param(params, project_entity) |
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.
The server side simply expects the project to be passed in.
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.
Just pointed out a couple little things. I'm guessing we'll need to wait for the feature release to get the version # for tests before we can release this? (Looks like CI is failing because of that now, anyways)
shotgun_api3/shotgun.py
Outdated
| ``visible`` property for. If the ``visible`` is present in ``properties`` and | ||
| ``project_entity`` is not set, an exception will be raised. Example: | ||
| ``{'type': 'Project', 'id': 3}`` | ||
| :param project_entity: Link to the project we wish to change the field visibility for. |
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.
Looks like you've documented project_entity twice here.
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.
Also, does project_entity only apply for visible property? Is that something we want to call out more explicitly?
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.
Good point. Let me know what you think of my update.
| Ensure the visibility of a field can be edited via the API. | ||
| """ | ||
| # If the version of Shotgun is too old, do not run this test. | ||
| # TODO: Update this with the real version number once the feature is released. |
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.
Just highlighting this TODO.
Pull Request Test Coverage Report for Build 1248
💛 - Coveralls |
Adds support for updating field visibility through the API.
This can be achieved by the following code:
where
projectis a dictionary referring to project in which we want to hide "sg_my_custom_field". Restoring visibility can be done viaNote: The build is currently failing because the feature hasn't been released in Shotgun. Once the feature is released the test will be updated to the right version check and the feature commited.