@@ -695,7 +695,7 @@ def classhelp(self, properties=None, label=''"(list)", width='500',
695695 if 'username' in properties .split ( ',' ):
696696 sort = 'username'
697697 else :
698- sort = find_sort_key ( self ._klass )
698+ sort = self ._klass . orderprop ( )
699699 sort = '&@sort=' + sort
700700 if property :
701701 property = '&property=%s' % property
@@ -1891,7 +1891,7 @@ def menu(self, size=None, height=None, showid=0, additional=[], value=None,
18911891 else :
18921892 sort_on = ('+' , sort_on )
18931893 else :
1894- sort_on = ('+' , find_sort_key ( linkcl ))
1894+ sort_on = ('+' , linkcl . orderprop ( ))
18951895
18961896 options = [opt
18971897 for opt in linkcl .filter (None , conditions , sort_on , (None , None ))
@@ -2077,7 +2077,7 @@ def menu(self, size=None, height=None, showid=0, additional=[],
20772077 else :
20782078 sort_on = ('+' , sort_on )
20792079 else :
2080- sort_on = ('+' , find_sort_key ( linkcl ))
2080+ sort_on = ('+' , linkcl . orderprop ( ))
20812081
20822082 options = [opt
20832083 for opt in linkcl .filter (None , conditions , sort_on )
@@ -2139,17 +2139,11 @@ def make_sort_function(db, classname, sort_on=None):
21392139 """
21402140 linkcl = db .getclass (classname )
21412141 if sort_on is None :
2142- sort_on = find_sort_key ( linkcl )
2142+ sort_on = linkcl . orderprop ( )
21432143 def sortfunc (a , b ):
21442144 return cmp (linkcl .get (a , sort_on ), linkcl .get (b , sort_on ))
21452145 return sortfunc
21462146
2147- def find_sort_key (linkcl ):
2148- if linkcl .getprops ().has_key ('order' ):
2149- return 'order'
2150- else :
2151- return linkcl .labelprop ()
2152-
21532147def handleListCGIValue (value ):
21542148 """ Value is either a single item or a list of items. Each item has a
21552149 .value that we're actually interested in.
0 commit comments