--- ZSQLExtend/ZSQLExtend.py 2004/09/27 20:31:40 1.35 +++ ZSQLExtend/ZSQLExtend.py 2004/09/27 20:43:58 1.36 @@ -335,18 +335,18 @@ class ZSQLExtendFolder(Folder,Persistent table=urllib.unquote(value) elif name=="-identify": identify=urllib.unquote(value) - identify=identify.split("=")[0]+"="+libpq.PgQuoteString(identify.split("=")[1]) + identify=identify.split("=")[0]+"="+sql_quote(identify.split("=")[1]) elif name=="-format": format=urllib.unquote(value) elif (not name[0]=="-") and (not len(value)==0): - changeList.append("\""+name+"\"="+libpq.PgQuoteString(urllib.unquote(value))) + changeList.append("\""+name+"\"="+sql_quote(urllib.unquote(value))) changeString=string.join(changeList,",") queryString="UPDATE %s SET %s WHERE %s"%(table,changeString,identify) self.ZSQLSimpleSearch(queryString) return self.REQUEST.RESPONSE.redirect(format) def ZSQLChange_old(self): - """Ändern von Einträgen""" + """change entries""" qs=self.REQUEST['QUERY_STRING'] #print "CHANGE QS",self.REQUEST #return self.REQUEST @@ -360,11 +360,11 @@ class ZSQLExtendFolder(Folder,Persistent table=urllib.unquote(value) elif name=="-identify": identify=urllib.unquote(value) - identify=identify.split("=")[0]+"="+libpq.PgQuoteString(identify.split("=")[1]) + identify=identify.split("=")[0]+"="+sql_quote(identify.split("=")[1]) elif name=="-format": format=urllib.unquote(value) elif (not name[0]=="-") and (not len(value)==0): - changeList.append("\""+name+"\"="+libpq.PgQuoteString(urllib.unquote(value))) + changeList.append("\""+name+"\"="+sql_quote(urllib.unquote(value))) changeString=string.join(changeList,",") queryString="UPDATE %s SET %s WHERE %s"%(table,changeString,identify) self.ZSQLSimpleSearch(queryString) @@ -564,7 +564,7 @@ class ZSQLExtendFolder(Folder,Persistent except: value="" - #value=libpq.PgQuoteString(value) + #value=sql_quote(value) if name==iCT+"lop": @@ -614,21 +614,21 @@ class ZSQLExtendFolder(Folder,Persistent namealt=name name="LOWER("+name+")" if op=="ct": - tmp=(name+" LIKE "+libpq.PgQuoteString("%"+value+"%")) + tmp=(name+" LIKE "+sql_quote("%"+value+"%")) elif op=="gt": - tmp=(name+">"+libpq.PgQuoteString(value)) + tmp=(name+">"+sql_quote(value)) elif op=="lt": - tmp=(name+"<"+libpq.PgQuoteString(value)) + tmp=(name+"<"+sql_quote(value)) elif op=="eq": - tmp=(name+"="+libpq.PgQuoteString(value)) + tmp=(name+"="+sql_quote(value)) elif op=="bw": - tmp=(name+" LIKE "+libpq.PgQuoteString(value+"%")) + tmp=(name+" LIKE "+sql_quote(value+"%")) elif op=="ew": - tmp=(name+" LIKE "+libpq.PgQuoteString("%"+value)) + tmp=(name+" LIKE "+sql_quote("%"+value)) elif op=="all": tmps=[] for word in value.split(" "): - tmps.append(name+" LIKE "+libpq.PgQuoteString("%"+word+"%")) + tmps.append(name+" LIKE "+sql_quote("%"+word+"%")) tmp=string.join(tmps,' AND ') @@ -652,17 +652,17 @@ class ZSQLExtendFolder(Folder,Persistent ## op="ct" ## name="LOWER("+name+")" ## if op=="ct": -## whereList.append(name+" LIKE "+libpq.PgQuoteString("%"+value+"%")) +## whereList.append(name+" LIKE "+sql_quote("%"+value+"%")) ## elif op=="gt": -## whereList.append(name+">"+libpq.PgQuoteString(value)) +## whereList.append(name+">"+sql_quote(value)) ## elif op=="lt": -## whereList.append(name+"<"+libpq.PgQuoteString(value)) +## whereList.append(name+"<"+sql_quote(value)) ## elif op=="eq": -## whereList.append(name+"="+libpq.PgQuoteString(value)) +## whereList.append(name+"="+sql_quote(value)) ## elif op=="bw": -## whereList.append(name+" LIKE "+libpq.PgQuoteString(value+"%")) +## whereList.append(name+" LIKE "+sql_quote(value+"%")) ## elif op=="ew": -## whereList.append(name+" LIKE "+libpq.PgQuoteString("%"+value)) +## whereList.append(name+" LIKE "+sql_quote("%"+value)) ## op="ct" ## #except: