I so wish English had no plural forms. What're they good for anyway?

This commit is contained in:
Kovid Goyal 2010-05-26 18:24:15 -06:00
commit a5da02be3b

View File

@ -779,8 +779,10 @@ class OnDeviceSearch(SearchQueryParser): # {{{
'title' : lambda x : getattr(x, 'title').lower(), 'title' : lambda x : getattr(x, 'title').lower(),
'author': lambda x: ' & '.join(getattr(x, 'authors')).lower(), 'author': lambda x: ' & '.join(getattr(x, 'authors')).lower(),
'collections':lambda x: ','.join(getattr(x, 'device_collections')).lower(), 'collections':lambda x: ','.join(getattr(x, 'device_collections')).lower(),
'format':lambda x: os.path.splitext(x.path)[1].lower() 'format':lambda x: os.path.splitext(x.path)[1].lower(),
} }
for x in ('author', 'format'):
q[x+'s'] = q[x]
for index, row in enumerate(self.model.db): for index, row in enumerate(self.model.db):
for locvalue in locations: for locvalue in locations:
accessor = q[locvalue] accessor = q[locvalue]