mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-12 17:57:43 +00:00
Add the show format for the Group.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user