Jump to content

How to select/populate custom attributes

Recommended Posts


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.

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.

Link to post
Share on other sites
  • 4 months later...

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
  • Create New...