-
Notifications
You must be signed in to change notification settings - Fork 198
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
Unable to specify correct filter to query and return all Project, Episode, and Shot fields together #273
Comments
Hello,
You just need to add ‘episode.Episode.name’ and ‘project.Project.name’ to the list of fields to retrieve, if I understood what you’re after.
Something like: ['code', ‘sg_sequence.Sequence.sg_status_list’, ‘episode.Episode.name’, ‘project.Project.name’ ]
Hope it helps.
… On 13 Dec 2022, at 14:21, David Marceau ***@***.***> wrote:
Using the following variables:
project_name = 'SuperStickman'
episode_name = 'Stic-101'
I want to extract ALL the Project, Episode and Shot fields together.
I tried these two different ways, but they don't display Project, Episode and Shot fields.
sg_shots = sg.find("Shot", [['project.Project.name', 'is', project_name],['episode.Episode.name', 'is', episode_name]], ['code', 'sg_sequence.Sequence.sg_status_list'])
sg_shots = sg.find("Shot", [['project.Project.name', 'is', project_name]], ['code', 'sg_sequence.Sequence.sg_status_list'])
How do I return a query result that returns ALL the Project, Episode and Shot fields together?
Thank you in advance.
—
Reply to this email directly, view it on GitHub <#273>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAULRSZJ427P2ZCOR334COTWNBZ7FANCNFSM6AAAAAAS5GSCZU>.
You are receiving this because you are subscribed to this thread.
|
I just tried that:
No fields from Episode are returned. Only fields from Shot and only the Project name.
|
I tried this as well:
But it returns with an error:
|
I guess your Shot was not linked to an Episode.
Just add “episode” to the list of fields to return to double check: if empty then the Shot is not linked to an episode.
If the episode is set on the Sequence, you can get it with `sg_sequence.Sequence.episode`, and its field values with `sg_sequence.Sequence.episode.Episode.code`
Check your SG schema for exact field values.
Cheers.
… On 13 Dec 2022, at 15:22, David Marceau ***@***.***> wrote:
I just tried that:
sg_shots = sg.find("Shot", [['project.Project.name', 'is', project_name]], ['code', 'sg_sequence.Sequence.sg_status_list', 'episode.Episode.name', 'project.Project.name' ])
No fields from Episode are returned. Only fields from Shot and only the Project name.
{'type': 'Shot', 'id': 8341, 'code': 'blahcode', 'sg_sequence.Sequence.sg_status_list': 'blahstatus', 'project.Project.name': 'SuperStickman'}
—
Reply to this email directly, view it on GitHub <#273 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAULRSYD7S3375OOQCWLQPTWNCBEBANCNFSM6AAAAAAS5GSCZU>.
You are receiving this because you commented.
|
Much appreciated. Thanks you will try those. The shot is not linked to an episode. |
BINGO:
Returns: {'type': 'Shot', 'id': 8345, 'code': 'blahcodes1', 'sg_sequence.Sequence.sg_status_list': 'blahstatus2', 'sg_sequence.Sequence.episode': {'id': 400, 'name': 'Stic-101', 'type': 'Episode'}, 'sg_sequence.Sequence.episode.Episode.code': 'Stic-101'} Thank you. We've got what we need with this. :) You're a super-hero monkeydev. |
How do I fetch the task name within this query as well?
I tried to fetch it but it's empty as well. Not linked as you mentioned? |
This is interesting, is there a way to use this style of syntax to extract specific fields for list relationships too? Say I make this query:
But I'd like to include additional fields in the |
@josh-mission I don't believe that is possible for multi-entity fields. see: https://community.shotgridsoftware.com/t/using-linked-fields-aka-bubbled-fields-in-api-requests/8697 |
Using the following variables:
I want to extract ALL the Project, Episode and Shot fields together.
I tried these two different ways, but they don't display Project, Episode and Shot fields.
How do I return a query result that returns ALL the Project, Episode and Shot fields together?
Thank you in advance.
The text was updated successfully, but these errors were encountered: