How to select/populate custom attributes
2 2

7 posts in this topic

Hi,

is there a way to get all the custom_attributes in a query or a session.populate() call? I can do

  session.query("select custom_attributes from Shot where ....")

but when I check the values with "auto_populating False", they are mostly Symbol(NOT_SET), except for default values.

I can't do "select custom_attributes.fstart from Shot where ..." because that throws 

  ftrack_api.exception.ServerError: Server reported error: KeyError(u'fstart')

as does session.populate(shot, "custom_attributes.fstart")

The reason I'm asking is that I usually need a bunch of custom attributes so I want to speed things up and reduce queries.

Share this post


Link to post
Share on other sites

I think you can get rid of some extra queries by selecting value:

15 hours ago, Tilt said:

  session.query("select custom_attributes.value from Shot where ....")

I'm working on a fix for this right now that will speedup custom attributes so that your query above will fetch all necessary data in one go. This is a larger change in our backend and api so there will be some time before it is properly tested and released. But just so you know; we are aware of this and working on it.

Share this post


Link to post
Share on other sites

Hi Mattias!

Are there any updates regarding this feature?

What I want is to get only the custom attributes value of a ftrack entity.

shot_custom_attributes = session.query("select custom_attributes from Shot where ....")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2