|
|
@ -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()
|
|
|
|