[Mpuls-commits] r3901 - in wasko/trunk: . waskoweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 6 12:57:55 CEST 2010


Author: bh
Date: 2010-10-06 12:57:55 +0200 (Wed, 06 Oct 2010)
New Revision: 3901

Modified:
   wasko/trunk/ChangeLog
   wasko/trunk/waskoweb/controllers/formularpage.py
Log:
More formularpage refactoring:

* waskoweb/controllers/formularpage.py
(FormularpageController._save): Removed.  With the latest changes
is was equivalent to the base class method.
(FormularpageController._handle_evaluation_number)
(FormularpageController._before_set_data_hook): Rename
_handle_evaluation_number to _before_set_data_hook because that
method is automatically called by the base class


Modified: wasko/trunk/ChangeLog
===================================================================
--- wasko/trunk/ChangeLog	2010-10-06 10:45:27 UTC (rev 3900)
+++ wasko/trunk/ChangeLog	2010-10-06 10:57:55 UTC (rev 3901)
@@ -1,3 +1,15 @@
+2010-10-06  Bernhard Herzog  <bh at intevation.de>
+
+	More formularpage refactoring:
+
+	* waskoweb/controllers/formularpage.py
+	(FormularpageController._save): Removed.  With the latest changes
+	is was equivalent to the base class method.
+	(FormularpageController._handle_evaluation_number)
+	(FormularpageController._before_set_data_hook): Rename
+	_handle_evaluation_number to _before_set_data_hook because that
+	method is automatically called by the base class
+
 2010-10-06 Roland Geider <roland.geider at intevation.de>
 
 	* waskoweb/model/appointment.py,

Modified: wasko/trunk/waskoweb/controllers/formularpage.py
===================================================================
--- wasko/trunk/waskoweb/controllers/formularpage.py	2010-10-06 10:45:27 UTC (rev 3900)
+++ wasko/trunk/waskoweb/controllers/formularpage.py	2010-10-06 10:57:55 UTC (rev 3901)
@@ -62,56 +62,8 @@
 
 
 class FormularpageController(FormularpageController):
-    @checkRole(('cm_ka'))
-    def save(self):
-        
-        # Extract the case ID for later use
-        case_id = request.params['page'].split(':')[1]
-        
-        # Save the request parameters for later use
-        form_result = convert2dic(request.params)
-        
-        factory = InstanceFactory(g.formedTree, PostgresDBInterface())
-        instance_tree = factory.loadInstanceTreeByIdentifier(
-            session['case'].id,
-            session.get('uncommited_fields'))
-        page_id = request.params['page']
-        try:
-            
-            apply_hidden_booleans(form_result)
 
-            # Special logic for the Evaluation-ID
-            self._handle_evaluation_number(case_id, form_result)
-            
-            instance_tree.setData(form_result)
-            session['uncommited_fields'] = instance_tree.commit()
-            session.save()
-            
-            # How to proceed after saving the data?
-            self._handle_repeat_group_redirects()
-
-            if request.params.has_key('savenext'):
-                page_id = session['navigation.tree'].getTreeItem(page_id).nextKey().key
-
-            # Check consistence of case and retag
-            self._check_case_validity(session['case'].id)
-
-        except SetDataException, err:
-            # Do nothing other than setting the status message. In the future the
-            # exception can be used to fill out the form again with htmlfill,
-            # which will clean up the renderer code a lot! But this is for the
-            # future
-            #error_status(_('Error while saving data'))
-            session['uncommited_fields'] = instance_tree.commit()
-            session.save()
-
-        phase_changed = self._handle_automatic_phase_change(page_id)
-        if phase_changed:
-            return phase_changed
-
-        return self.select(page_id)
-
-    def _handle_evaluation_number(self, case_id, form_result):
+    def _before_set_data_hook(self, case_id, form_result):
         """Set or Reset the evaluation number if the form_result is for page 2
         """
         if request.params['page'].split(':')[0] == 'page-2':



More information about the Mpuls-commits mailing list