[Checkins] SVN: zope3org/trunk/src/zorg/multiform/ bug in rename

Bernd Dorn bernd.dorn at fhv.at
Tue Apr 11 18:19:42 EDT 2006


Log message for revision 66867:
  bug in rename

Changed:
  U   zope3org/trunk/src/zorg/multiform/container/views.py
  U   zope3org/trunk/src/zorg/multiform/multiform.py

-=-
Modified: zope3org/trunk/src/zorg/multiform/container/views.py
===================================================================
--- zope3org/trunk/src/zorg/multiform/container/views.py	2006-04-11 22:01:00 UTC (rev 66866)
+++ zope3org/trunk/src/zorg/multiform/container/views.py	2006-04-11 22:19:42 UTC (rev 66867)
@@ -115,6 +115,9 @@
     @multiform.parentAction("Save", inputMode=True,
                             condition=multiform.anySubFormInputMode)
     def handle_save_action(self, action, data):
+
+        if not isSelected(self,action):
+            return
         if form.applyChanges(self.context, self.form_fields,
                              data, self.adapters):
             notify(ObjectModifiedEvent(self.context))
@@ -128,6 +131,7 @@
             self.status = (_("Updated on ${date_time}", mapping=m),)
         else:
             self.status = (_('No changes'),)
+        ISelection(self.context).selected=False    
         self.newInputMode = False
 
 

Modified: zope3org/trunk/src/zorg/multiform/multiform.py
===================================================================
--- zope3org/trunk/src/zorg/multiform/multiform.py	2006-04-11 22:01:00 UTC (rev 66866)
+++ zope3org/trunk/src/zorg/multiform/multiform.py	2006-04-11 22:19:42 UTC (rev 66867)
@@ -152,10 +152,10 @@
         self.updateSelection()
         super(MultiFormBase,self).update()
         hasErrors = False
-        for form in self.getForms():
+        for form in list(self.getForms()):
             form.update()
         refresh = False
-        for form in self.getForms():
+        for form in list(self.getForms()):
             if form.newInputMode is not None:
                 newInputMode = form.newInputMode
                 context = self.context[form.context.__name__]
@@ -193,6 +193,11 @@
     def getForms(self):
         # we have to use the keys here to support all actions that
         # modifies the keys of our mapping, e.g. rename, delete
+        keys = list(self.context.keys())
+        deleted = filter(lambda x: x not in keys,self.subForms.keys())
+        print "deleted----------",deleted
+        for k in deleted:
+            del(self.subForms[k])
         for name in self.context.keys():
             if not self.subForms.has_key(name):
                 self.setUpForm(name,self.context[name],



More information about the Checkins mailing list