witten
/
luminotes
Archived
1
0
Fork 0

quote() function now correctly handles bools as input such that SQLite gets a 't' or 'f' value as appropriate.

This commit is contained in:
Dan Helfman 2008-08-18 18:07:08 -07:00
parent 98042c5c3f
commit f6fbf724f3
1 changed files with 5 additions and 1 deletions

View File

@ -83,7 +83,11 @@ def quote( value ):
if value is None:
return "null"
value = unicode( value )
if isinstance( value, bool ):
value = value and "t" or "f"
else:
value = unicode( value )
return "'%s'" % value.replace( "'", "''" ).replace( "\\", "\\\\" )