def get_output_types_for_entity(entity_id): """ Get output types from all output files created for given entity. """ output_types = (OutputType.query.join(OutputFile).filter( OutputFile.entity_id == entity_id).order_by(OutputType.name).all()) return OutputType.serialize_list(output_types)
def get_output_types_for_instance(asset_instance_id, temporal_entity_id=None): """ Get output types from all output files created for given instance. """ output_types = (OutputType.query.join(OutputFile).filter( OutputFile.asset_instance_id == asset_instance_id, OutputFile.temporal_entity_id == temporal_entity_id, ).order_by(OutputType.name).all()) return OutputType.serialize_list(output_types)