allow to pass attrs as argument explicitly tls-sprint
authorsylvain.thenault@logilab.fr
Mon, 02 Mar 2009 20:43:58 +0100
branchtls-sprint
changeset 983 cf1caf460081
parent 982 ba5257deec7d
child 984 536e421b082b
allow to pass attrs as argument explicitly
server/sources/extlite.py
--- a/server/sources/extlite.py	Mon Mar 02 20:43:08 2009 +0100
+++ b/server/sources/extlite.py	Mon Mar 02 20:43:58 2009 +0100
@@ -203,7 +203,7 @@
         """add a new entity to the source"""
         raise NotImplementedError()
 
-    def local_update_entity(self, session, entity):
+    def local_update_entity(self, session, entity, attrs=None):
         """update an entity in the source
 
         This is not provided as update_entity implementation since usually
@@ -211,7 +211,8 @@
         and the source implementor may use this method if necessary
         """
         cu = session.pool[self.uri]
-        attrs = self.sqladapter.preprocess_entity(entity)
+        if attrs is None:
+            attrs = self.sqladapter.preprocess_entity(entity)
         sql = self.sqladapter.sqlgen.update(str(entity.e_schema), attrs, ['eid'])
         cu.execute(sql, attrs)