fixed Issue 1436:SQLFORM.grid search widget omits decimal data type

This commit is contained in:
mdipierro
2013-04-08 12:40:52 -05:00
parent 9f35635233
commit 58247e3d6b
2 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.4.6-stable+timestamp.2013.04.08.11.12.25
Version 2.4.6-stable+timestamp.2013.04.08.12.40.11
+8 -1
View File
@@ -1648,7 +1648,14 @@ class SQLFORM(FORM):
selectfields = []
for field in fields:
name = str(field).replace('.', '-')
options = search_options.get(field.type.split(' ')[0], None)
# treat ftype 'decimal' as 'double'
# (this fixes problems but needs refactoring!
ftype = field.type.split(' ')[0]
if ftype.startswith('decimal'): ftype = 'double'
elif ftype=='bigint': ftype = 'integer'
elif ftype.startswith('big-'): ftype = ftype[4:]
# end
options = search_options.get(ftype, None)
if options:
label = isinstance(
field.label, str) and T(field.label) or field.label