server/sources/datafeed.py
changeset 9975 98b4f7fa2e3a
parent 9879 21278eb03bbf
child 9990 c84ad981fc4a
equal deleted inserted replaced
9946:ec88c1a1904a 9975:98b4f7fa2e3a
   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