equal
deleted
inserted
replaced
379 byetype.setdefault(etype, []).append(str(eid)) |
379 byetype.setdefault(etype, []).append(str(eid)) |
380 for etype, eids in byetype.iteritems(): |
380 for etype, eids in byetype.iteritems(): |
381 self.warning('delete %s %s entities', len(eids), etype) |
381 self.warning('delete %s %s entities', len(eids), etype) |
382 cnx.execute('DELETE %s X WHERE X eid IN (%s)' |
382 cnx.execute('DELETE %s X WHERE X eid IN (%s)' |
383 % (etype, ','.join(eids))) |
383 % (etype, ','.join(eids))) |
384 cnx.commit() |
384 cnx.commit() |
385 |
385 |
386 def update_if_necessary(self, entity, attrs): |
386 def update_if_necessary(self, entity, attrs): |
387 entity.complete(tuple(attrs)) |
387 entity.complete(tuple(attrs)) |
388 # check modification date and compare attribute values to only update |
388 # check modification date and compare attribute values to only update |
389 # what's actually needed |
389 # what's actually needed |