diff --git a/tui_rsync/models/models.py b/tui_rsync/models/models.py index 99f8f92..269f8ff 100644 --- a/tui_rsync/models/models.py +++ b/tui_rsync/models/models.py @@ -188,6 +188,16 @@ class Group(BaseModel): def __repl__(self) -> str: return f"{self.label}" + def show_format(self) -> str: + output = f"[b]label:[/] {self.label}\n" \ + f"[b]sources:[/] \n" + + for source in self.sources: + prefix = '\t' + output+=f"{source.source.show_format(prefix)}\n" + + return output + class GroupSource(BaseModel): group = ForeignKeyField(Group, backref='sources') source = ForeignKeyField(Source)