Got the ondevice composite column optimization to work.

This commit is contained in:
Charles Haley 2011-05-29 18:28:21 +01:00
parent 35bf5ed46e
commit f25c423261

View File

@ -200,6 +200,11 @@ class CacheRow(list): # {{{
def __getslice__(self, i, j):
return self.__getitem__(slice(i, j))
def refresh_composites(self):
for c in self._composites:
self[c] = None
self._must_do = True
# }}}
class ResultCache(SearchQueryParser): # {{{
@ -914,12 +919,11 @@ class ResultCache(SearchQueryParser): # {{{
return len(self._map)
def refresh_ondevice(self, db):
if self.composites:
self.refresh(db)
ondevice_col = self.FIELD_MAP['ondevice']
for item in self._data:
if item is not None:
item[ondevice_col] = db.book_on_device_string(item[0])
item.refresh_composites()
def refresh(self, db, field=None, ascending=True):
temp = db.conn.get('SELECT * FROM meta2')