def get_files_size(self, prefix=None): bytes = 0 for file in self.files: bytes += file.size size = bytes if prefix is not None: size = round(Tools.size_metric(bytes, prefix), 3) return str(size)
def get_metric_size(self, prefix): from app.components.tools import Tools size = round(Tools.size_metric(self.size, prefix), 3) return str(size)