deex Posted October 19, 2015 Report Posted October 19, 2015 Hello, I have added custom attributes to shots.When i do a query like this :tasks = session.query( 'Shot where name is {0} and ' 'parent.name is {1} and ' 'project.name is {2} ' .format(shotName, sequenceName, projectName ) )My custom attributes are not here. How can i do this please ?
deex Posted October 19, 2015 Author Report Posted October 19, 2015 Ok i will try this : http://ftrack-python-api.rtd.ftrack.com/en/latest/example/custom_attribute.html#example-custom-attribute
deex Posted October 19, 2015 Author Report Posted October 19, 2015 Doesn't work : session = ftrack_api.Session() shots = session.query( #===================================================== # 'select fstart, fend, duration, startHandles, endHandles, fsequenceend, fsequencestart ' #===================================================== 'Shot where name is {0} and ' 'parent.name is {1} and ' 'project.name is {2} ' .format(shotName, sequenceName, projectName ) ) for i in shots: print i.keys() print i['custom_attributes'] print i['custom_attributes'] File "C:\Python27\lib\site-packages\ftrack_api\entity\base.py", line 167, in __getitem__ raise KeyError(key)KeyError: 'custom_attributes'
Mattias Lagergren Posted October 20, 2015 Report Posted October 20, 2015 Hi, What version of ftrack are you running on the server? Custom attributes support requires ftrack server version 3.3.2+:http://ftrack.rtd.ftrack.com/en/latest/release/release_notes.html
deex Posted October 20, 2015 Author Report Posted October 20, 2015 Hi, What version of ftrack are you running on the server? Custom attributes support requires ftrack server version 3.3.2+:http://ftrack.rtd.ftrack.com/en/latest/release/release_notes.html Hi, The server version is : 3.2.4.4348How do we can update please ? Thank you,Damien
Mattias Lagergren Posted October 21, 2015 Report Posted October 21, 2015 Hi Damien, I will contact you by e-mail to help you get upgraded.
deex Posted November 20, 2015 Author Report Posted November 20, 2015 Hi, We are using FTrack 3.3.6.4382, last new API, and we have empty result when we query custom attributes...
Mattias Lagergren Posted November 24, 2015 Report Posted November 24, 2015 Hey, Could you provide some more information, such as: * Code example* Information about the project structure and custom attributes you are using* Expected result More information here:http://ftrack-python-api.rtd.ftrack.com/en/latest/example/custom_attribute.html
deex Posted December 2, 2015 Author Report Posted December 2, 2015 Hi, Code example :import ftrack_apisession = ftrack_api.Session()projects = session.query( 'Project where status is active and ' '(full_name like "ftrack test")')tasks = session.query('Task where project.id is "{0}"'.format(projects[0]['id'])).all()for task in tasks: customAttr = task['custom_attributes'] print customAttr.keys() for attr in customAttr: print attr.keys()The project : Custom attribute (some are hierarchical) : Code result :[][][][][][][][][][][][][][][]Expected result :Something not empty. Hey, Could you provide some more information, such as: * Code example* Information about the project structure and custom attributes you are using* Expected result More information here:http://ftrack-python-api.rtd.ftrack.com/en/latest/example/custom_attribute.html
Mattias Lagergren Posted December 3, 2015 Report Posted December 3, 2015 Hi deex, I noticed that you are querying for tasks but the screenshot you shared is showing a Sequence. Do you have custom attributes on the tasks as well, other than hierarchical? Accessing hierarchical attributes are not supported at present:http://ftrack-python-api.rtd.ftrack.com/en/latest/example/custom_attribute.html#hierarchical-attributes
deex Posted December 3, 2015 Author Report Posted December 3, 2015 Ah, all my custom attributes are hierarchical. It is why it doesn't work. Hi deex, I noticed that you are querying for tasks but the screenshot you shared is showing a Sequence. Do you have custom attributes on the tasks as well, other than hierarchical? Accessing hierarchical attributes are not supported at present:http://ftrack-python-api.rtd.ftrack.com/en/latest/example/custom_attribute.html#hierarchical-attributes
Nebukadhezer Posted February 17, 2017 Report Posted February 17, 2017 is there news on this topic ? From the docs it reads as though it was possible, only I need to loop through all parents myself, But I cannot even see hierarchical attr in the custom attributes keys ... cheers
Mattias Lagergren Posted February 20, 2017 Report Posted February 20, 2017 On 17/02/2017 at 4:56 PM, Nebukadhezer said: is there news on this topic ? From the docs it reads as though it was possible, only I need to loop through all parents myself, But I cannot even see hierarchical attr in the custom attributes keys ... No news at the moment. On your custom attribute configuration there should be a `is_hierarchical` to indicate if it is a an hierarchical attribute..
Recommended Posts
Archived
This topic is now archived and is closed to further replies.