equal
deleted
inserted
replaced
419 byetype.setdefault(etype, []).append(str(eid)) |
419 byetype.setdefault(etype, []).append(str(eid)) |
420 for etype, eids in byetype.iteritems(): |
420 for etype, eids in byetype.iteritems(): |
421 self.warning('delete %s %s entities', len(eids), etype) |
421 self.warning('delete %s %s entities', len(eids), etype) |
422 cnx.execute('DELETE %s X WHERE X eid IN (%s)' |
422 cnx.execute('DELETE %s X WHERE X eid IN (%s)' |
423 % (etype, ','.join(eids))) |
423 % (etype, ','.join(eids))) |
424 cnx.commit() |
424 cnx.commit() |
425 |
425 |
426 def update_if_necessary(self, entity, attrs): |
426 def update_if_necessary(self, entity, attrs): |
427 entity.complete(tuple(attrs)) |
427 entity.complete(tuple(attrs)) |
428 # check modification date and compare attribute values to only update |
428 # check modification date and compare attribute values to only update |
429 # what's actually needed |
429 # what's actually needed |