mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-20 05:37: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:
|
def __repl__(self) -> str:
|
||||||
return f"{self.label}"
|
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):
|
class GroupSource(BaseModel):
|
||||||
group = ForeignKeyField(Group, backref='sources')
|
group = ForeignKeyField(Group, backref='sources')
|
||||||
source = ForeignKeyField(Source)
|
source = ForeignKeyField(Source)
|
||||||
|
|||||||
Reference in New Issue
Block a user