server/sources/datafeed.py
changeset 9990 c84ad981fc4a
parent 9897 fa44db7da2dc
parent 9975 98b4f7fa2e3a
child 10089 6346f53c85f1
equal deleted inserted replaced
9974:b240b33c7125 9990:c84ad981fc4a
   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