From 642aef515c4043d7ca72b7239285e468327e6a5b Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 20 Oct 2001 23:44:27 +0000 Subject: [PATCH] Hyperdatabase sorts strings-that-look-like-numbers as numbers now. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@315 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 3 ++- roundup/hyperdb.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d89136c..686d30f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,7 +2,8 @@ This file contains the changes to the Roundup system over time. The entries are given with the most recent entry first. 2001-10-?? - 0.3.0 -Added: +Feature: + . Hyperdatabase sorts strings-that-look-like-numbers as numbers now. Admin Tool (roundup-admin): . Interactive mode for running multiple (independant at present) commands. . Tabular display of nodes. diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py index dbca837..391c6f3 100644 --- a/roundup/hyperdb.py +++ b/roundup/hyperdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: hyperdb.py,v 1.26 2001-10-16 03:48:01 richard Exp $ +# $Id: hyperdb.py,v 1.27 2001-10-20 23:44:27 richard Exp $ # standard python modules import cPickle, re, string @@ -697,6 +697,12 @@ class Class: bv = bn[prop] = bv.lower() if (isinstance(propclass, String) or isinstance(propclass, Date)): + # it might be a string that's really an integer + try: + av = int(av) + bv = int(bv) + except: + pass if dir == '+': r = cmp(av, bv) if r != 0: return r @@ -840,6 +846,9 @@ def Choice(name, *options): # # $Log: not supported by cvs2svn $ +# Revision 1.26 2001/10/16 03:48:01 richard +# admin tool now complains if a "find" is attempted with a non-link property. +# # Revision 1.25 2001/10/11 00:17:51 richard # Reverted a change in hyperdb so the default value for missing property # values in a create() is None and not '' (the empty string.) This obviously -- 2.30.2