Enhance used and empty fields search with :false and :true instead of :none

This commit is contained in:
John Schember 2009-07-01 06:42:12 -04:00
parent 840d567078
commit 4bf1a46acd

View File

@ -213,7 +213,10 @@ class ResultCache(SearchQueryParser):
for item in self._data: for item in self._data:
if item is None: continue if item is None: continue
for loc in location: for loc in location:
if (not item[loc] or item[loc] == [] or item[loc] == 0 or item[loc] == '') and query == 'none': if query == 'false' and (not item[loc] or item[loc].strip() == ''):
matches.add(item[0])
break
if query == 'true' and (item[loc] and item[loc].strip() != ''):
matches.add(item[0]) matches.add(item[0])
break break
if rating_query and item[loc] and loc == MAP['rating'] and rating_query == int(item[loc]): if rating_query and item[loc] and loc == MAP['rating'] and rating_query == int(item[loc]):