File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2314,13 +2314,19 @@ def register_propclass(prop, cls):
23142314
23152315
23162316def make_sort_function (db , classname , sort_on = None ):
2317- """Make a sort function for a given class
2317+ """Make a sort function for a given class.
2318+
2319+ The list being sorted may contain mixed ids and labels.
23182320 """
23192321 linkcl = db .getclass (classname )
23202322 if sort_on is None :
23212323 sort_on = linkcl .orderprop ()
23222324 def sortfunc (a , b ):
2323- return cmp (linkcl .get (a , sort_on ), linkcl .get (b , sort_on ))
2325+ if num_re .match (a ):
2326+ a = linkcl .get (a , sort_on )
2327+ if num_re .match (b ):
2328+ b = linkcl .get (b , sort_on )
2329+ return cmp (a , b )
23242330 return sortfunc
23252331
23262332def handleListCGIValue (value ):
You can’t perform that action at this time.
0 commit comments