changeset 238:e48d6052688f

Add controller move_entries method Add a general method to move entries to another project.
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 09 Apr 2013 20:41:09 +0200
parents 13692255bc71
children cc24919789be
files getan/controller.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/getan/controller.py	Tue Apr 09 20:40:31 2013 +0200
+++ b/getan/controller.py	Tue Apr 09 20:41:09 2013 +0200
@@ -75,6 +75,14 @@
         if self.view:
             self.view.update_entries(entries)
 
+    def move_entries(self, entries, project):
+        old_project = self.project_by_id(entries[0].project_id)
+        self.backend.move_entries(entries, project.id)
+        project.entries = self.backend.load_entries(project.id)
+        old_project.entries = self.backend.load_entries(old_project.id)
+        self.update_entries(old_project)
+        self.project_view.update_rows()
+
     def move_selected_entries(self, project):
         old_project = None
         entries = []
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)