From 2591f0136a1062277254432a5443ff582a487a56 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 2 Oct 2019 18:52:29 +0200 Subject: [PATCH] custom attributes from avalon group are queried much faster now --- pype/ftrack/lib/avalon_sync.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pype/ftrack/lib/avalon_sync.py b/pype/ftrack/lib/avalon_sync.py index 511e03267a..c7f7804448 100644 --- a/pype/ftrack/lib/avalon_sync.py +++ b/pype/ftrack/lib/avalon_sync.py @@ -380,9 +380,13 @@ def import_to_avalon( def get_avalon_attr(session, split_hierarchical=False): custom_attributes = [] hier_custom_attributes = [] - query = 'CustomAttributeGroup where name is "avalon"' - all_avalon_attr = session.query(query).one() - for cust_attr in all_avalon_attr['custom_attribute_configurations']: + cust_attrs_query = ( + "select id, entity_type, object_type_id, is_hierarchical" + " from CustomAttributeConfiguration" + " where group.name = \"avalon\"" + ) + all_avalon_attr = session.query(cust_attrs_query).all() + for cust_attr in all_avalon_attr: if 'avalon_' in cust_attr['key']: continue