Skip to content

Commit a33396f

Browse files
author
Richard Jones
committed
Fixed sorting by clicking on column headings.
1 parent 1db5be1 commit a33396f

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

roundup/htmltemplate.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: htmltemplate.py,v 1.9 2001-07-29 08:27:40 richard Exp $
1+
# $Id: htmltemplate.py,v 1.10 2001-07-29 09:28:23 richard Exp $
22

33
import os, re, StringIO, urllib, cgi, errno
44

@@ -394,14 +394,12 @@ def sortby(sort_name, columns, filter, sort, group, filterspec):
394394
for name in sort:
395395
dir = name[0]
396396
if dir == '-':
397-
dir = ''
398-
else:
399397
name = name[1:]
400398
if sort_name == name:
401-
if dir == '':
402-
s_dir = '-'
403-
elif dir == '-':
399+
if dir == '-':
404400
s_dir = ''
401+
else:
402+
s_dir = '-'
405403
else:
406404
m.append(dir+urllib.quote(name))
407405
m.insert(0, s_dir+urllib.quote(sort_name))
@@ -709,6 +707,10 @@ def newitem(client, templates, db, classname, form, replace=re.compile(
709707

710708
#
711709
# $Log: not supported by cvs2svn $
710+
# Revision 1.9 2001/07/29 08:27:40 richard
711+
# Fixed handling of passed-in values in form elements (ie. during a
712+
# drill-down)
713+
#
712714
# Revision 1.8 2001/07/29 07:01:39 richard
713715
# Added vim command to all source so that we don't get no steenkin' tabs :)
714716
#

roundup/hyperdb.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: hyperdb.py,v 1.8 2001-07-29 08:27:40 richard Exp $
1+
# $Id: hyperdb.py,v 1.9 2001-07-29 09:28:23 richard Exp $
22

33
# standard python modules
44
import cPickle, re, string
@@ -633,7 +633,6 @@ def filter(self, filterspec, sort, group, num_re = re.compile('^\d+$')):
633633
else:
634634
m.append((entry[0], entry[1:]))
635635
group = m
636-
637636
# now, sort the result
638637
def sortfun(a, b, sort=sort, group=group, properties=self.getprops(),
639638
db = self.db, cl=self):
@@ -674,6 +673,9 @@ def sortfun(a, b, sort=sort, group=group, properties=self.getprops(),
674673
# nodes; or finally on the node ids.
675674
elif propclass.isLinkType:
676675
link = db.classes[propclass.classname]
676+
if av is None and bv is not None: return -1
677+
if av is not None and bv is None: return 1
678+
if av is None and bv is None: return 0
677679
if link.getprops().has_key('order'):
678680
if dir == '+':
679681
r = cmp(link.get(av, 'order'),
@@ -788,6 +790,10 @@ def Choice(name, *options):
788790

789791
#
790792
# $Log: not supported by cvs2svn $
793+
# Revision 1.8 2001/07/29 08:27:40 richard
794+
# Fixed handling of passed-in values in form elements (ie. during a
795+
# drill-down)
796+
#
791797
# Revision 1.7 2001/07/29 07:01:39 richard
792798
# Added vim command to all source so that we don't get no steenkin' tabs :)
793799
#

0 commit comments

Comments
 (0)