0

find project name from shot id

Hi all,

I'm trying to find the syntax to return the project name/id that a shot is a part of.

So I have a shot that has an id of 3482 and Id like to write a query to return the project that this that is in.

eg:

cur_shot_id = 3482

project = sg.find('Project',[['id','contains',cur_shot_id]])

print project['name']

Is totally off the mark?

Thanks for any help

Steve

 

 

2 comments

  • 0
    Avatar
    Tony Aiello

    # retrieve the project entity for a shot

    shot = sg.find_one('Shot', [('id', 'is', cur_shot_id)], ['project'])

    print shot['project']['name']

  • 0
    Avatar
    steve

    Thanks Tony

    :)

     

Please sign in to leave a comment.