changeset 362:90c09cca49c3

Fix loading entries of a project Projects.entries is converted into a read only property. Therefore it is not allowed to set the entries directly. Instead the load_entries method must be used.
author Björn Ricks <bjoern.ricks@intevation.de>
date Mon, 03 Mar 2014 15:08:07 +0100
parents 2373618e787d
children 1be996254ad5
files getan/backend.py getan/controller.py
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/getan/backend.py	Mon Mar 03 15:00:20 2014 +0100
+++ b/getan/backend.py	Mon Mar 03 15:08:07 2014 +0100
@@ -290,7 +290,7 @@
             logger.debug("Added new entry '%s' of project '%s' into db"
                          % (desc, project.desc))
 
-            project.entries = self.load_entries(project.id)
+            project.load_entries()
         finally:
             close(cur)
 
--- a/getan/controller.py	Mon Mar 03 15:00:20 2014 +0100
+++ b/getan/controller.py	Mon Mar 03 15:08:07 2014 +0100
@@ -68,11 +68,10 @@
         logger.debug("GetanController: update entries for project %s." %
                      project.id)
 
-        entries = self.backend.load_entries(project.id)
-        project.entries = entries
+        project.load_entries()
 
         if self.view:
-            self.view.update_entries(entries)
+            self.view.update_entries(project.entries)
 
     def move_entry(self, entry, project):
         self.move_entries([entry], project)
@@ -80,7 +79,6 @@
     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)
         self.update_entries(old_project)
         self.project_view.update_rows()
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)