Alberto GZ Posted May 18, 2018 Report Share Posted May 18, 2018 I want to get the value from a custom_attribute that is added to project, that I think is not a type either a object... My attempt is this: def get(self, project_id): result = { 'extra_info': { 'legend': {}, }, custom_attrs = self.session.query( 'select config from CustomAttributeConfiguration where key is "{0}"' ).one() legend = custom_attrs['custom_attributes']['project_legend'] result['extra_info']['legend'] = legend There is possible do a query for name instead key for custom attributes? Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted May 22, 2018 Report Share Posted May 22, 2018 Hey - could you let me know a bit more about the purpose? Is it to read a custom attribute's value from a project? We have an article here with some examples: http://ftrack-python-api.rtd.ftrack.com/en/stable/example/custom_attribute.html Link to comment Share on other sites More sharing options...
Alberto GZ Posted May 24, 2018 Author Report Share Posted May 24, 2018 I have a code already given which is getting some data from FTrack. This data are custom attributes added to types and objects in the project. I triying to get the value from a custom attribute added to project (root level of the project), replicating the code, but not works. Query that I have seems is defined for get types and objects. From Ftrack api documentation I don't able to get the value of custom attribute. Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted May 25, 2018 Report Share Posted May 25, 2018 The values of custom attributes can be read from the custom_attributes relation. Like this: print project['custom_attributes']['my_text_field'] Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.