From 934619c41aa5a0a9b8df0cae65a3b3edc37e5176 Mon Sep 17 00:00:00 2001 From: stefan Date: Thu, 12 Feb 2009 05:10:59 +0000 Subject: [PATCH] Fix issue2550500 git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4123 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/templating.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/roundup/cgi/templating.py b/roundup/cgi/templating.py index 106df96..313cfb0 100644 --- a/roundup/cgi/templating.py +++ b/roundup/cgi/templating.py @@ -695,7 +695,7 @@ class HTMLClass(HTMLInputMixin, HTMLPermissions): if 'username' in properties.split( ',' ): sort = 'username' else: - sort = find_sort_key(self._klass) + sort = self._klass.orderprop() sort = '&@sort=' + sort if property: property = '&property=%s'%property @@ -1891,7 +1891,7 @@ class LinkHTMLProperty(HTMLProperty): else: sort_on = ('+', sort_on) else: - sort_on = ('+', find_sort_key(linkcl)) + sort_on = ('+', linkcl.orderprop()) options = [opt for opt in linkcl.filter(None, conditions, sort_on, (None, None)) @@ -2077,7 +2077,7 @@ class MultilinkHTMLProperty(HTMLProperty): else: sort_on = ('+', sort_on) else: - sort_on = ('+', find_sort_key(linkcl)) + sort_on = ('+', linkcl.orderprop()) options = [opt for opt in linkcl.filter(None, conditions, sort_on) @@ -2139,17 +2139,11 @@ def make_sort_function(db, classname, sort_on=None): """ linkcl = db.getclass(classname) if sort_on is None: - sort_on = find_sort_key(linkcl) + sort_on = linkcl.orderprop() def sortfunc(a, b): return cmp(linkcl.get(a, sort_on), linkcl.get(b, sort_on)) return sortfunc -def find_sort_key(linkcl): - if linkcl.getprops().has_key('order'): - return 'order' - else: - return linkcl.labelprop() - def handleListCGIValue(value): """ Value is either a single item or a list of items. Each item has a .value that we're actually interested in. -- 2.30.2