diff --git a/tui_rsync/core/components/backup_plan/application/Queries/__init__.py b/tui_rsync/core/components/backup_plan/application/Queries/__init__.py new file mode 100644 index 0000000..aa5c7b0 --- /dev/null +++ b/tui_rsync/core/components/backup_plan/application/Queries/__init__.py @@ -0,0 +1,3 @@ +from .get_all_backup_plans_query import GetAllBackupBackupPlansQuery + +__all__ = ['GetAllBackupBackupPlansQuery'] diff --git a/tui_rsync/core/components/backup_plan/application/Queries/get_all_backup_plans_query.py b/tui_rsync/core/components/backup_plan/application/Queries/get_all_backup_plans_query.py new file mode 100644 index 0000000..418ca40 --- /dev/null +++ b/tui_rsync/core/components/backup_plan/application/Queries/get_all_backup_plans_query.py @@ -0,0 +1,8 @@ +from tui_rsync.infrastructure.orm.dto.dtos import BackupPlanDTO + +from tui_rsync.infrastructure.orm.models import BackupPlanModel + + +class GetAllBackupBackupPlansQuery: + def execute(self): + return (BackupPlanDTO.to_domain(model) for model in BackupPlanModel.select().iterator())