mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-12 17:57:43 +00:00
Add the method to add destionation to a source.
This commit is contained in:
@@ -76,12 +76,20 @@ class Source(BaseModel):
|
||||
destinations=[],
|
||||
args=src_sync_cmd
|
||||
)
|
||||
|
||||
for destination in destinations:
|
||||
des_path, _ = Path.get_or_create(path=destination)
|
||||
src_des, _ = Destination.get_or_create(source=src, path=des_path)
|
||||
src.add_destionation(destination)
|
||||
|
||||
src.save()
|
||||
return src
|
||||
|
||||
def add_destionation(self, destination):
|
||||
destination_path, _ = Path.get_or_create(path=destination)
|
||||
src_destination, _ = Destination.get_or_create(
|
||||
source=self,
|
||||
path=destination_path
|
||||
)
|
||||
|
||||
def update_label(self, new_label):
|
||||
self.label = new_label
|
||||
self.save()
|
||||
|
||||
Reference in New Issue
Block a user