Commit 1fdadc8f authored by 's avatar

merged fix 1590 from 2.2 branch

parent a461b5ef
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
however, if x is ommitted or an empty string, then the value however, if x is ommitted or an empty string, then the value
inserted is 'null'. inserted is 'null'.
''' '''
__rcs_id__='$Id: sqlvar.py,v 1.10 2000/08/07 20:17:16 brian Exp $' __rcs_id__='$Id: sqlvar.py,v 1.11 2000/09/07 17:04:07 brian Exp $'
############################################################################ ############################################################################
# Copyright # Copyright
...@@ -129,7 +129,7 @@ __rcs_id__='$Id: sqlvar.py,v 1.10 2000/08/07 20:17:16 brian Exp $' ...@@ -129,7 +129,7 @@ __rcs_id__='$Id: sqlvar.py,v 1.10 2000/08/07 20:17:16 brian Exp $'
# rights reserved. # rights reserved.
# #
############################################################################ ############################################################################
__version__='$Revision: 1.10 $'[11:-2] __version__='$Revision: 1.11 $'[11:-2]
from DocumentTemplate.DT_Util import ParseError, parse_params, name_param from DocumentTemplate.DT_Util import ParseError, parse_params, name_param
from string import find, split, join, atoi, atof from string import find, split, join, atoi, atof
...@@ -172,7 +172,10 @@ class SQLVar: ...@@ -172,7 +172,10 @@ class SQLVar:
if t=='int': if t=='int':
try: try:
if type(v) is StringType: atoi(v) if type(v) is StringType:
if v[-1:]=='L':
v=v[:-1]
atoi(v)
else: v=str(int(v)) else: v=str(int(v))
except: except:
if not v and args.has_key('optional') and args['optional']: if not v and args.has_key('optional') and args['optional']:
...@@ -181,7 +184,10 @@ class SQLVar: ...@@ -181,7 +184,10 @@ class SQLVar:
'Invalid integer value for <em>%s</em>' % name) 'Invalid integer value for <em>%s</em>' % name)
elif t=='float': elif t=='float':
try: try:
if type(v) is StringType: atof(v) if type(v) is StringType:
if v[-1:]=='L':
v=v[:-1]
atof(v)
else: v=str(float(v)) else: v=str(float(v))
except: except:
if not v and args.has_key('optional') and args['optional']: if not v and args.has_key('optional') and args['optional']:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment