示例#1
0
 def get_by_system(system_class: str, parser: Dict[str, Any]) \
         -> List[Entity]:
     if system_class not in g.classes:
         raise InvalidSystemClassError
     return [
         Entity(row)
         for row in Db.get_by_system_class(system_class, parser)
     ]
示例#2
0
 def get_by_view(code_: str, parser: dict[str, Any]) -> list[Entity]:
     if code_ not in g.view_class_mapping:
         raise InvalidCodeError  # pragma: no cover
     sys_class = Db.get_by_system_class(g.view_class_mapping[code_], parser)
     return [Entity(row) for row in sys_class]
示例#3
0
 def get_by_class(class_code: str, parser: dict[str, Any]) -> list[Entity]:
     if class_code not in g.cidoc_classes:
         raise InvalidCidocClassCode  # pragma: no cover
     return [Entity(row) for row in Db.get_by_class_code(class_code, parser)]