Remus Avram Posted July 19, 2016 Report Share Posted July 19, 2016 Hi all, how can I add a new status type to one of this Shot/Asset Build/Task/MilestoneVersions in a schema using the ftrack-python-api? Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted July 20, 2016 Report Share Posted July 20, 2016 15 hours ago, Remus Avram said: how can I add a new status type to one of this Shot/Asset Build/Task/MilestoneVersions in a schema using the ftrack-python-api? Hey Remus! Unfortunately this is quite complex, not documented or recommended by us. The api schemas that exposes the necessary entities even has some of the relations "private". As of now we recommend sticking to read access, using the ProjectSchema entity help functions (get_statuses and get_types). Those functions tries to hide some of the underlying complexity. If you still want to go down this route I would recommend looking at the code in https://bitbucket.org/ftrack/ftrack-python-api/src/3302fe001c5836889d571a7dec591b7b56766182/source/ftrack_api/entity/project_schema.py?at=master&fileviewer=file-view-default, to see how the statuses and types are structured in the workflow schemas. Modifications will require a per-user API KEY with access to System Settings. Link to comment Share on other sites More sharing options...
Remus Avram Posted July 20, 2016 Author Report Share Posted July 20, 2016 Hi Mattias, thanks for your answer! The types and the statuses already exists. What I would like to do is to just add them to the schema. For example there are already keys for the 'ProjectSchema' called '_version_workflow' and '_task_workflow' which manage the statuses for the version and respective task workflow. And key '_task_type_schema' which manage the types for the tasks. Example: session = ftrack_api.Session() session.query("ProjectSchema where name is '%s'" % (name)) print schema.keys() print schema['_task_workflow'].keys() print schema['_task_type_schema'].keys() Result: [u'_task_workflow', u'name', u'_overrides', u'_version_workflow', u'_task_type_schema', u'id', u'_schemas'] [u'overrides', u'id', u'statuses', u'name'] [u'id', u'types', u'name'] Unfortunately, there are no keys to manage the projectSchema for assetbuild, milestone and shot. Is it possible to be implemented? Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted July 20, 2016 Report Share Posted July 20, 2016 These are handled slightly differently. You can see it best here: https://bitbucket.org/ftrack/ftrack-python-api/src/3302fe001c5836889d571a7dec591b7b56766182/source/ftrack_api/entity/project_schema.py?at=master&fileviewer=file-view-default#project_schema.py-31 Best regards, Mattias L Link to comment Share on other sites More sharing options...
Remus Avram Posted July 20, 2016 Author Report Share Posted July 20, 2016 Thanks for the quick ansewer! Yes, they are handled sligtly differently in a very complex way like you said. Do you know if there any plans to improve this? Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted July 20, 2016 Report Share Posted July 20, 2016 40 minutes ago, Remus Avram said: Thanks for the quick ansewer! Yes, they are handled sligtly differently in a very complex way like you said. Do you know if there any plans to improve this? Yes we have, but up until now it has mostly been seen and prioritised as an internal difficulty that we've had to deal with when building things. Externally we've tried to simplify through those functions. Link to comment Share on other sites More sharing options...
Remus Avram Posted July 20, 2016 Author Report Share Posted July 20, 2016 I see. Using built-in functions is easier and better. Is there any estimation when this will be implemented? Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted July 20, 2016 Report Share Posted July 20, 2016 19 minutes ago, Remus Avram said: Is there any estimation when this will be implemented? No estimate at the moment I'm afraid.. If you absolutely need it your best options is perhaps to reference the code I linked to Link to comment Share on other sites More sharing options...
Remus Avram Posted July 21, 2016 Author Report Share Posted July 21, 2016 I understand. I will try to use parts of the code which you linked to. Unfortunately, it's not only getting data, it's also updating it. Link to comment Share on other sites More sharing options...
Remus Avram Posted August 8, 2016 Author Report Share Posted August 8, 2016 Is it a way to get and set statuses and types for a schema using the legacy api? Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted August 10, 2016 Report Share Posted August 10, 2016 Hi Remus, You can which get statuses and types are available for a project but you cannot alter them I'm afraid. Link to comment Share on other sites More sharing options...
Remus Avram Posted February 27, 2017 Author Report Share Posted February 27, 2017 On 8/10/2016 at 8:39 AM, Mattias Lagergren said: ... but you cannot alter them I'm afraid. Is this feature planned to be added in the future? Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted February 28, 2017 Report Share Posted February 28, 2017 22 hours ago, Remus Avram said: Is this feature planned to be added in the future? Yes, this will most likely be added, but I do not have any dates for it at the moment. We're more and more relying on the API ourselves when building the application so down the line things like this should be available. A problem at the moment is that the underlying model is quite complex - both to understand and to get right. Either we will need to simplify it or come up with good helper methods. This is the main reason why it is not there already. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.