ionav Posted May 9, 2017 Report Share Posted May 9, 2017 Hi, I'm trying to print out custom attributes for an asset build following the example below. However, trying to print ab["custom_attrubtes"].items() gives me a 'custom_attributes' key error. Has something recently changed? http://ftrack-python-api.rtd.ftrack.com/en/latest/example/custom_attribute.html#example-custom-attribute Thanks Link to comment Share on other sites More sharing options...
tokejepsen Posted May 10, 2017 Report Share Posted May 10, 2017 Hey, Think there is a typo in your code. Try this; print ab["custom_attributes"].items() Link to comment Share on other sites More sharing options...
ionav Posted May 10, 2017 Author Report Share Posted May 10, 2017 Hey, Thanks for getting back to me. My apologies, there 100% is a typo there. That's what I get for trying to make a minimal example quickly. The initial problem I was hitting is that when I try and set custom attributes on an asset build, I get the error: "'Custom attributes must be creted explicitly for the given entity type before being set.'" ab["custom_attributes"]['category'] = category I have scripts that have successfully set attributes this way in the past, hence wondering if something had changed. Thanks Link to comment Share on other sites More sharing options...
tokejepsen Posted May 11, 2017 Report Share Posted May 11, 2017 Have you created the custom attribute on your Ftrack site? "System settings" > "Advanced" > "Custom Attributes" Link to comment Share on other sites More sharing options...
ionav Posted May 11, 2017 Author Report Share Posted May 11, 2017 I have, months ago. And indeed I have assets published with them already set. Link to comment Share on other sites More sharing options...
Remus Avram Posted May 15, 2017 Report Share Posted May 15, 2017 Which is the category custom attribute type and what are you trying to set to it? Link to comment Share on other sites More sharing options...
ionav Posted May 18, 2017 Author Report Share Posted May 18, 2017 It turns out our problem was caused by our server being upgraded to a version requiring API version 1.0.4 or later, which we weren't using, hence not being able to set custom attributes. Link to comment Share on other sites More sharing options...
Lucas Correia Posted May 19, 2017 Report Share Posted May 19, 2017 Thanks for following up. For future reference, the server version 3.5 requires ftrack-python-api 1.0.4 or higher. Version 1.0.3 will be unable to use custom attributes properly (what ionav experienced) and versions prior to 1.0.3 will fail to initialise the session with a ServerCompatibilityError. For more information, see the migration notes. We are still polishing a few things before we will start to roll out ftrack 3.5 to hosted sites and will be in contact before then. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.