--- a/server/sources/pyrorql.py Wed Mar 10 16:07:24 2010 +0100
+++ b/server/sources/pyrorql.py Mon Mar 01 11:26:14 2010 +0100
@@ -203,7 +203,8 @@
insert=False)
# entity has been deleted from external repository but is not known here
if eid is not None:
- repo.delete_info(session, eid)
+ entity = session.entity_from_eid(eid, etype)
+ repo.delete_info(session, entity, self.uri, extid)
except:
self.exception('while updating %s with external id %s of source %s',
etype, extid, self.uri)
@@ -350,11 +351,11 @@
self._query_cache.clear()
entity.clear_all_caches()
- def delete_entity(self, session, etype, eid):
+ def delete_entity(self, session, entity):
"""delete an entity from the source"""
cu = session.pool[self.uri]
- cu.execute('DELETE %s X WHERE X eid %%(x)s' % etype,
- {'x': self.eid2extid(eid, session)}, 'x')
+ cu.execute('DELETE %s X WHERE X eid %%(x)s' % entity.__regid__,
+ {'x': self.eid2extid(entity.eid, session)}, 'x')
self._query_cache.clear()
def add_relation(self, session, subject, rtype, object):