mirror of
https://gitlab.com/KKlochko/tui-rsync.git
synced 2026-08-20 05:37: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=[],
|
destinations=[],
|
||||||
args=src_sync_cmd
|
args=src_sync_cmd
|
||||||
)
|
)
|
||||||
|
|
||||||
for destination in destinations:
|
for destination in destinations:
|
||||||
des_path, _ = Path.get_or_create(path=destination)
|
src.add_destionation(destination)
|
||||||
src_des, _ = Destination.get_or_create(source=src, path=des_path)
|
|
||||||
src.save()
|
src.save()
|
||||||
return src
|
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):
|
def update_label(self, new_label):
|
||||||
self.label = new_label
|
self.label = new_label
|
||||||
self.save()
|
self.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user