Beispiel #1
0
 def get_linked_entities(id_: int,
                         codes: Union[str, List[str]],
                         inverse: bool = False,
                         nodes: bool = False) -> List['Entity']:
     from openatlas.models.entity import Entity
     codes = codes if isinstance(codes, list) else [codes]
     return Entity.get_by_ids(Db.get_linked_entities(id_, codes, inverse),
                              nodes=nodes)
Beispiel #2
0
 def get_linked_entities(id_: int,
                         codes: Union[str, list[str]],
                         inverse: bool = False,
                         types: bool = False) -> list[Entity]:
     from openatlas.models.entity import Entity
     codes = codes if isinstance(codes, list) else [codes]
     return Entity.get_by_ids(Db.get_linked_entities_inverse(
         id_, codes) if inverse else Db.get_linked_entities(id_, codes),
                              types=types)