Skip to content

Example: Updating a Shot

kporangehat edited this page Dec 10, 2010 · 2 revisions

To update a Shot, you need to provide the id of the Shot and a list of columns you wish to update.

data = { 'description': 'Open on a beautiful field with fuzzy bunnies',
         'sg_status_list': 'ip' }
result = sg.update('Shot', 40435, data)

This will update the description and the sg_status_list fields for the Shot with id of 40435.

  • data is a list of key/value pairs where the key is the column name to update and the value the value.
  • sg is the Shotgun API instance.
  • update() is the API method we are calling. We provide it with the entity type we're searching for and our filters.

The variable result now contains the Shot object that was updated:

{'description': 'Opening establishing shot with titles and fuzzy bunnies',
'sg_status_list': 'ip',
'type': 'Shot',
'id': 40435}
Clone this wiki locally