should use a set for pending fields
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 13 Jan 2010 15:57:57 +0100
changeset 4226 67dd296f864d
parent 4225 c49bb6e3d343
child 4227 39f01be4a6c5
should use a set for pending fields
web/formfields.py
web/views/editcontroller.py
--- a/web/formfields.py	Wed Jan 13 15:56:31 2010 +0100
+++ b/web/formfields.py	Wed Jan 13 15:57:57 2010 +0100
@@ -822,7 +822,7 @@
                 continue
             typed_eid = form.actual_eid(eid)
             if typed_eid is None:
-                form._cw.data['pendingfields'].append( (form, self) )
+                form._cw.data['pendingfields'].add( (form, self) )
                 return None
             eids.add(typed_eid)
         return eids
--- a/web/views/editcontroller.py	Wed Jan 13 15:56:31 2010 +0100
+++ b/web/views/editcontroller.py	Wed Jan 13 15:57:57 2010 +0100
@@ -72,7 +72,7 @@
             req.set_shared_data('__maineid', form['__maineid'], querydata=True)
         # no specific action, generic edition
         self._to_create = req.data['eidmap'] = {}
-        self._pending_fields = req.data['pendingfields'] = []
+        self._pending_fields = req.data['pendingfields'] = set()
         todelete = self._cw.get_pending_deletes()
         toinsert = self._cw.get_pending_inserts()
         try:
@@ -207,7 +207,7 @@
                     elif form.edited_entity.has_eid():
                         self.handle_relation(form, field, value, origvalues)
                     else:
-                        self._pending_fields.append( (form, field) )
+                        self._pending_fields.add( (form, field) )
 
         except ProcessFormError, exc:
             self.errors.append((field, exc))