Return to ZSQLExtend.py CVS log | Up to [Repository] / ZSQLExtend |
version 1.37, 2004/09/27 20:45:45 | version 1.38, 2004/09/27 20:48:54 |
---|---|
Line 17 def sql_quote(v): | Line 17 def sql_quote(v): |
# quote dictionary | # quote dictionary |
quote_dict = {"\'": "''", "\\": "\\\\"} | quote_dict = {"\'": "''", "\\": "\\\\"} |
for dkey in quote_dict.keys(): | for dkey in quote_dict.keys(): |
if find(v, dkey) >= 0: | if string.find(v, dkey) >= 0: |
v=join(split(v,dkey),quote_dict[dkey]) | v=join(split(v,dkey),quote_dict[dkey]) |
return "'%s'" % v | return "'%s'" % v |