Commit 0c189b9b authored by Christian Zagrodnick's avatar Christian Zagrodnick

- converting value only to str if it is neither str already or unicode. The

  underlying database adapter should convert a unicode to the encoding the
  database expects.
parent 69aa2e24
......@@ -47,7 +47,7 @@
however, if x is ommitted or an empty string, then the value
inserted is 'null'.
'''
__rcs_id__='$Id: sqlvar.py,v 1.13 2002/08/14 21:50:59 mj Exp $'
__rcs_id__='$Id: sqlvar.py,v 1.14 2003/03/19 20:21:23 zagy Exp $'
############################################################################
# Copyright
......@@ -57,7 +57,7 @@ __rcs_id__='$Id: sqlvar.py,v 1.13 2002/08/14 21:50:59 mj Exp $'
# rights reserved.
#
############################################################################
__version__='$Revision: 1.13 $'[11:-2]
__version__='$Revision: 1.14 $'[11:-2]
from DocumentTemplate.DT_Util import ParseError, parse_params, name_param
from string import find, split, join, atoi, atof
......@@ -123,7 +123,8 @@ class SQLVar:
raise ValueError, (
'Invalid floating-point value for <em>%s</em>' % name)
else:
v=str(v)
if not isinstance(v, (str, unicode)):
v=str(v)
if not v and t=='nb':
if args.has_key('optional') and args['optional']:
return 'null'
......
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