Add the show format for the Group.

This commit is contained in:
2023-06-25 18:04:00 +03:00
parent fceb22396a
commit 8958e328e8
+10
View File
@@ -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)