Wrong index type for selection strings that are not multivalued.

This commit is contained in:
Gaetan Delannay 2010-09-20 11:33:54 +02:00
parent 7c2b8fed11
commit 9f4db88bdf
9 changed files with 41 additions and 30 deletions

View file

@ -402,11 +402,12 @@ class Type:
res = True
return res
def isSortable(self, usage='search'):
def isSortable(self, usage):
'''Can fields of this type be used for sorting purposes (when sorting
search results (p_usage="search") or when sorting reference fields
(p_usage="ref")?'''
if usage == 'search': return self.indexed
if usage == 'search':
return self.indexed and not self.isMultiValued()
elif usage == 'ref':
return self.type in ('Integer', 'Float', 'Boolean', 'Date') or \
((self.type == 'String') and (self.format == 0))