Retrieve substructure from plantuml should support retrieval of referenced Records
Retrieve substructure from plantuml should support retrieval of referenced Records.
Currently the function retrieve_substructure can be used to generate containers of parts of a data model, by recursively downloading record types and properties for a given record type.
This function could be extended to support the generation of containers including records and files.
Please consider, moving it to apiutils as its use is no longer restricted to support the generation of uml diagrams.
Here is a piece of code, that was used temporarily for this task:
# TODO: clean up this hack
# TODO: make it also work for files
if is_reference(prop.datatype) and prop.value is not None:
r = db.Record(id=prop.value).retrieve()
retrieve_substructure([r], depth-1, result_id_set, result_container, False)
if r.id not in result_id_set:
result_container.append(r)
result_id_set.add(r.id)