Skip to content

Commit 6c02727

Browse files
author
Alexander Smishlajev
committed
column type for Number changed from Integer to Double...
...(conforming with rdbms backends). allow lists of Numbers in filter criteria. this fixes testFilteringNumber.
1 parent 11db2ea commit 6c02727

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

roundup/backends/back_metakit.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.86 2004-09-30 09:48:12 a1s Exp $
1+
# $Id: back_metakit.py,v 1.87 2004-09-30 10:12:24 a1s Exp $
22
'''Metakit backend for Roundup, originally by Gordon McMillan.
33
44
Known Current Bugs:
@@ -789,7 +789,7 @@ def set_inner(self, nodeid, **propvalues):
789789
v = 0
790790
else:
791791
try:
792-
v = int(value)
792+
v = float(value)
793793
except ValueError:
794794
raise TypeError, "%s (%s) is not numeric"%(key, repr(value))
795795
if not BACKWARDS_COMPATIBLE:
@@ -1312,7 +1312,10 @@ def filter(self, search_matches, filterspec, sort=(None,None),
13121312
# If range creation fails - ignore that search parameter
13131313
pass
13141314
elif isinstance(prop, hyperdb.Number):
1315-
where[propname] = int(value)
1315+
if type(value) is _LISTTYPE:
1316+
orcriteria[propname] = [float(v) for v in value]
1317+
else:
1318+
where[propname] = float(value)
13161319
else:
13171320
where[propname] = str(value)
13181321
v = self.getview()
@@ -1648,7 +1651,7 @@ def import_list(self, propnames, proplist):
16481651
elif isinstance(prop, hyperdb.Interval):
16491652
value = date.Interval(value).serialise()
16501653
elif isinstance(prop, hyperdb.Number):
1651-
value = int(value)
1654+
value = float(value)
16521655
elif isinstance(prop, hyperdb.Boolean):
16531656
value = int(value)
16541657
elif isinstance(prop, hyperdb.Link) and value:
@@ -1825,7 +1828,7 @@ class FileName(hyperdb.String):
18251828
hyperdb.Interval : 'S',
18261829
hyperdb.Password : 'S',
18271830
hyperdb.Boolean : 'I',
1828-
hyperdb.Number : 'I',
1831+
hyperdb.Number : 'D',
18291832
}
18301833
class FileClass(hyperdb.FileClass, Class):
18311834
''' like Class but with a content property

0 commit comments

Comments
 (0)