mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
define query keys
This commit is contained in:
parent
a91c0368e2
commit
f0f4a1c65b
1 changed files with 13 additions and 1 deletions
|
|
@ -321,6 +321,16 @@ def get_hierarchical_attributes(session, entity, attr_names, attr_defaults={}):
|
|||
class SyncEntitiesFactory:
|
||||
dbcon = AvalonMongoDB()
|
||||
|
||||
cust_attr_query_keys = [
|
||||
"id",
|
||||
"key",
|
||||
"entity_type",
|
||||
"object_type_id",
|
||||
"is_hierarchical",
|
||||
"config",
|
||||
"default"
|
||||
]
|
||||
|
||||
project_query = (
|
||||
"select full_name, name, custom_attributes"
|
||||
", project_schema._task_type_schema.types.name"
|
||||
|
|
@ -866,7 +876,9 @@ class SyncEntitiesFactory:
|
|||
def set_cutom_attributes(self):
|
||||
self.log.debug("* Preparing custom attributes")
|
||||
# Get custom attributes and values
|
||||
custom_attrs, hier_attrs = get_pype_attr(self.session)
|
||||
custom_attrs, hier_attrs = get_pype_attr(
|
||||
self.session, query_keys=self.cust_attr_query_keys
|
||||
)
|
||||
ent_types = self.session.query("select id, name from ObjectType").all()
|
||||
ent_types_by_name = {
|
||||
ent_type["name"]: ent_type["id"] for ent_type in ent_types
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue