From 3c393509eb7a5a46c1cdce8301a7e99aee2459c2 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Fri, 23 Jun 2023 19:12:51 +0300 Subject: [PATCH] Add the method to update a source path. --- tui_rsync/models/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tui_rsync/models/models.py b/tui_rsync/models/models.py index 71f2eb3..8ac642f 100644 --- a/tui_rsync/models/models.py +++ b/tui_rsync/models/models.py @@ -94,6 +94,11 @@ class Source(BaseModel): self.label = new_label self.save() + def update_source_path(self, new_path): + new_source_path, _ = Path.get_or_create(path=new_path) + self.source = new_source_path + self.save() + def update_args(self, args): args_obj = SyncCommand.get_sync_command(args) self.args = args_obj