Jump to content

How to select/populate custom attributes


Tilt

Recommended Posts

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.

Link to comment
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 comment
Share on other sites

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...