tokejepsen Posted December 10, 2016 Report Share Posted December 10, 2016 Hey, I'm trying to query an asset directly under a project and get a couple of KeyError's from various attributes I would expect to be present on the project. The full error is this "Server reported error: KeyError(u"No attribute u'root' exists for schema u'Context'.")", and the various keys I've had to exclude are; exclusions = [ "full_name", "disk_id", "status", "project_schema_id", ] Why would this be happening? Link to comment Share on other sites More sharing options...
instinct-vfx Posted December 12, 2016 Report Share Posted December 12, 2016 Hey there, not sure without actual queries/code, but i think this is the same limitation that i have hit. The reason is, that context is a dynamic (or polymorphic) entity that may be different entity types. Hence it does not contain all the attributes that an actual instance may or may not have. If this is what you are seeing then this was addressed in 3.3.35: NEW APIDeveloperAdded support for complex queries with projections and criteria containg attributes from concrete subclasses. See also: http://ftrack.rtd.ftrack.com/en/latest/developing/api/query_syntax.html#developing-api-query-syntax-queries-involving-relations-to-subclasses Cheers, Thorsten Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted December 12, 2016 Report Share Posted December 12, 2016 As Thorsten mentioned this is mostly solved by the 3.3.35 release. The explanation for this issue is a bit technical but comes from the fact that the asset.parent relation is polymorphic, pointing to the common base class Context. Both Project and TypedContext (Shot, Task, et.c) inherits from Context and up until 3.3.35 you could not use attributes from the concrete subclasses in selection or filters when traversing such relations. Link to comment Share on other sites More sharing options...
tokejepsen Posted December 12, 2016 Author Report Share Posted December 12, 2016 Ahh, thanks for the explanation Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.