diff roundup/backends/back_anydbm.py @ 2247:7d5398391610

fixes to anydbm filtering
author Richard Jones <richard@users.sourceforge.net>
date Tue, 04 May 2004 00:16:07 +0000
parents c8a06e10e2c6
children 1261e04d66d6
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py	Tue May 04 00:02:23 2004 +0000
+++ b/roundup/backends/back_anydbm.py	Tue May 04 00:16:07 2004 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-#$Id: back_anydbm.py,v 1.143 2004-04-26 00:46:34 richard Exp $
+#$Id: back_anydbm.py,v 1.144 2004-05-04 00:16:06 richard Exp $
 '''This module defines a backend that saves the hyperdatabase in a
 database chosen by anydbm. It is guaranteed to always be available in python
 versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several
@@ -1776,11 +1776,12 @@
             def sortfun(a, b, directions=directions, n=range(len(directions))):
                 for i in n:
                     if a[i] == b[i]: continue
-                    if directions[i] == '-':
+                    if directions[i] == '+':
                         return cmp(a[i],b[i])
                     else:
                         return cmp(b[i],a[i])
-                return 0
+                # for consistency, sort by the id if the items are equal
+                return cmp(a[-2], b[-2])
             matches.sort(sortfun)
 
         # pull the id out of the individual entries

Roundup Issue Tracker: http://roundup-tracker.org/