From: stefan Date: Thu, 12 Feb 2009 05:10:59 +0000 (+0000) Subject: Fix issue2550500 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=934619c41aa5a0a9b8df0cae65a3b3edc37e5176;p=roundup.git Fix issue2550500 git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4123 57a73879-2fb5-44c3-a270-3262357dd7e2 --- 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.