From 9eab6740f8a31853423a22e5bf186c98055db8d2 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 29 Jul 2001 09:28:23 +0000 Subject: [PATCH] Fixed sorting by clicking on column headings. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@136 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/htmltemplate.py | 14 ++++++++------ roundup/hyperdb.py | 10 ++++++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/roundup/htmltemplate.py b/roundup/htmltemplate.py index 7d574fd..c2d0397 100644 --- a/roundup/htmltemplate.py +++ b/roundup/htmltemplate.py @@ -1,4 +1,4 @@ -# $Id: htmltemplate.py,v 1.9 2001-07-29 08:27:40 richard Exp $ +# $Id: htmltemplate.py,v 1.10 2001-07-29 09:28:23 richard Exp $ import os, re, StringIO, urllib, cgi, errno @@ -394,14 +394,12 @@ def sortby(sort_name, columns, filter, sort, group, filterspec): for name in sort: dir = name[0] if dir == '-': - dir = '' - else: name = name[1:] if sort_name == name: - if dir == '': - s_dir = '-' - elif dir == '-': + if dir == '-': s_dir = '' + else: + s_dir = '-' else: m.append(dir+urllib.quote(name)) m.insert(0, s_dir+urllib.quote(sort_name)) @@ -709,6 +707,10 @@ def newitem(client, templates, db, classname, form, replace=re.compile( # # $Log: not supported by cvs2svn $ +# Revision 1.9 2001/07/29 08:27:40 richard +# Fixed handling of passed-in values in form elements (ie. during a +# drill-down) +# # Revision 1.8 2001/07/29 07:01:39 richard # Added vim command to all source so that we don't get no steenkin' tabs :) # diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py index bc1013f..252194c 100644 --- a/roundup/hyperdb.py +++ b/roundup/hyperdb.py @@ -1,4 +1,4 @@ -# $Id: hyperdb.py,v 1.8 2001-07-29 08:27:40 richard Exp $ +# $Id: hyperdb.py,v 1.9 2001-07-29 09:28:23 richard Exp $ # standard python modules import cPickle, re, string @@ -633,7 +633,6 @@ class Class: else: m.append((entry[0], entry[1:])) group = m - # now, sort the result def sortfun(a, b, sort=sort, group=group, properties=self.getprops(), db = self.db, cl=self): @@ -674,6 +673,9 @@ class Class: # nodes; or finally on the node ids. elif propclass.isLinkType: link = db.classes[propclass.classname] + if av is None and bv is not None: return -1 + if av is not None and bv is None: return 1 + if av is None and bv is None: return 0 if link.getprops().has_key('order'): if dir == '+': r = cmp(link.get(av, 'order'), @@ -788,6 +790,10 @@ def Choice(name, *options): # # $Log: not supported by cvs2svn $ +# Revision 1.8 2001/07/29 08:27:40 richard +# Fixed handling of passed-in values in form elements (ie. during a +# drill-down) +# # Revision 1.7 2001/07/29 07:01:39 richard # Added vim command to all source so that we don't get no steenkin' tabs :) # -- 2.30.2