mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
use 'get_representations' instead of 'convert_to_db_filters'
This commit is contained in:
parent
c65dd9747f
commit
da8e25f4a1
1 changed files with 9 additions and 12 deletions
|
|
@ -280,19 +280,16 @@ class AbstractTemplateLoader:
|
|||
def get_placeholder_representations(
|
||||
self, placeholder, current_asset, linked_assets
|
||||
):
|
||||
# TODO This approach must be changed. Placeholders should return
|
||||
# already prepared data and not query them here.
|
||||
# - this is impossible to handle using query functions
|
||||
placeholder_db_filters = placeholder.convert_to_db_filters(
|
||||
placeholder_representations = placeholder.get_representations(
|
||||
current_asset,
|
||||
linked_assets)
|
||||
# get representation by assets
|
||||
for db_filter in placeholder_db_filters:
|
||||
placeholder_representations = list(legacy_io.find(db_filter))
|
||||
for representation in reduce(update_representations,
|
||||
placeholder_representations,
|
||||
dict()).values():
|
||||
yield representation
|
||||
linked_assets
|
||||
)
|
||||
for repre_doc in reduce(
|
||||
update_representations,
|
||||
placeholder_representations,
|
||||
dict()
|
||||
).values():
|
||||
yield repre_doc
|
||||
|
||||
def load_data_is_incorrect(
|
||||
self, placeholder, last_representation, ignored_ids):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue