implemented function 'get_contexts_for_repre_docs' to get representation contexts from already queried representations

This commit is contained in:
Jakub Trllo 2022-09-09 19:15:49 +02:00
parent 778f2c09ad
commit abbe7b7a36

View file

@ -87,13 +87,20 @@ def get_repres_contexts(representation_ids, dbcon=None):
if not dbcon:
dbcon = legacy_io
contexts = {}
if not representation_ids:
return contexts
return {}
project_name = dbcon.active_project()
repre_docs = get_representations(project_name, representation_ids)
return get_contexts_for_repre_docs(project_name, repre_docs)
def get_contexts_for_repre_docs(project_name, repre_docs):
contexts = {}
if not repre_docs:
return contexts
repre_docs_by_id = {}
version_ids = set()
for repre_doc in repre_docs: