Title: feature: saving hierarchical entities in one transaction - batch mode on steroids · Issue #383 · shotgunsoftware/python-api · GitHub
Open Graph Title: feature: saving hierarchical entities in one transaction - batch mode on steroids · Issue #383 · shotgunsoftware/python-api
X Title: feature: saving hierarchical entities in one transaction - batch mode on steroids · Issue #383 · shotgunsoftware/python-api
Description: I think batch mode is great as it provides speed, saves roundtrips and is safe as a single transaction. What would be an awesome extension is being able to save hierarchies of related entities: batch_data = [ {"request_type": "create", "...
Open Graph Description: I think batch mode is great as it provides speed, saves roundtrips and is safe as a single transaction. What would be an awesome extension is being able to save hierarchies of related entities: bat...
X Description: I think batch mode is great as it provides speed, saves roundtrips and is safe as a single transaction. What would be an awesome extension is being able to save hierarchies of related entities: bat...
Opengraph URL: https://github.com/shotgunsoftware/python-api/issues/383
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feature: saving hierarchical entities in one transaction - batch mode on steroids","articleBody":"I think [batch mode](https://developers.shotgridsoftware.com/python-api/reference.html#shotgun_api3.shotgun.Shotgun.batch) is great as it provides speed, saves roundtrips and is safe as a single transaction.\n\nWhat would be an awesome extension is being able to save hierarchies of related entities:\n\n```python\nbatch_data = [\n {\"request_type\": \"create\", \"entity_type\": \"Shot\", \"entity_id\": -1, \"data\": {\"code\": \"LAX_0001\", \"project\": project}},\n {\"request_type\": \"create\", \"entity_type\": \"Shot\", \"entity_id\": -2, \"data\": {\"code\": \"LAX_0002\", \"project\": project}},\n {\"request_type\": \"create\", \"entity_type\": \"Version\", \"data\": {\"code\": \"LAX_0001_v001\", \"entity\":{\"type\":\"shot\", \"id\":-1}}},\n {\"request_type\": \"create\", \"entity_type\": \"Version\", \"data\": {\"code\": \"LAX_0001_v002\", \"entity\":{\"type\":\"shot\", \"id\":-1}}},\n {\"request_type\": \"create\", \"entity_type\": \"Version\", \"data\": {\"code\": \"LAX_0002_v003\", \"entity\":{\"type\":\"shot\", \"id\":-2}}},\n]\nsg.batch(batch_data)\n```\n\nNo new fields are needed just negative ids and the \"only\" trick would be to save those entities with a negative id first so that the following ones can reference the generated id's.\n\nThanks for considering it! Maybe one day someone sets up a whole show in one transaction :)","author":{"url":"https://github.com/patrickwolf","@type":"Person","name":"patrickwolf"},"datePublished":"2025-05-22T05:36:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/383/python-api/issues/383"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b251c09b-580a-51a0-9db3-d08d1cc6d266 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB4E:24665B:48209AD:5EB2CD8:6992F147 |
| html-safe-nonce | e0e17d4f1caa6d1d8400d7255af6ff0f1207115da3e39f2c8d247d317b8289ee |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjRFOjI0NjY1Qjo0ODIwOUFEOjVFQjJDRDg6Njk5MkYxNDciLCJ2aXNpdG9yX2lkIjoiNzUyNDUyMjg1MDI1MTg5NTExMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | dfea92d1d1a759b29f69c02b1a41c99c18fd300b55877f81bc4b7399c035cc50 |
| hovercard-subject-tag | issue:3082110047 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/shotgunsoftware/python-api/383/issue_layout |
| twitter:image | https://opengraph.githubassets.com/48d3871ef31a29b4b481d1009fca69ccb4f56e7a61cd4ee8b1359dd45bad1486/shotgunsoftware/python-api/issues/383 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/48d3871ef31a29b4b481d1009fca69ccb4f56e7a61cd4ee8b1359dd45bad1486/shotgunsoftware/python-api/issues/383 |
| og:image:alt | I think batch mode is great as it provides speed, saves roundtrips and is safe as a single transaction. What would be an awesome extension is being able to save hierarchies of related entities: bat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | patrickwolf |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01ab16879a3159e6f0717ab948b9b562e162a6aafd1f4393b786b07b747df244 |
| turbo-cache-control | no-preview |
| go-import | github.com/shotgunsoftware/python-api git https://github.com/shotgunsoftware/python-api.git |
| octolytics-dimension-user_id | 317894 |
| octolytics-dimension-user_login | shotgunsoftware |
| octolytics-dimension-repository_id | 748742 |
| octolytics-dimension-repository_nwo | shotgunsoftware/python-api |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 748742 |
| octolytics-dimension-repository_network_root_nwo | shotgunsoftware/python-api |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b1570f3928bef80fa5fc7890ce0942e9b696ad9d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width