--- ZSQLExtend/ZSQLExtend.py 2005/11/25 12:14:13 1.75 +++ ZSQLExtend/ZSQLExtend.py 2005/12/22 20:33:11 1.76 @@ -434,9 +434,10 @@ class ZSQLExtendFolder(Folder,Persistent def ZSQLSimpleSearch(self,query=None,max_rows=1000000): """simple search""" - + if not query: query=self.query + if (hasattr(self,"_v_searchSQL") and (self._v_searchSQL == None)) or (not hasattr(self,"_v_searchSQL")): @@ -444,9 +445,9 @@ class ZSQLExtendFolder(Folder,Persistent self._v_searchSQL.max_rows_=max_rows try: - return self._v_searchSQL.__call__(var=query) except : + if sys.exc_info()[0]=="Database Error": try: self.getConnectionObj().manage_open_connection() @@ -454,10 +455,12 @@ class ZSQLExtendFolder(Folder,Persistent zLOG.LOG("ZSQLSimpleSearch",zLOG.ERROR, '%s %s'%sys.exc_info()[:2]) else: try: + self._v_searchSQL.max_rows_=max_rows return self._v_searchSQL.__call__(var=query) except : + if sys.exc_info()[0]=="Database Error": try: self.getConnectionObj().manage_open_connection() @@ -584,11 +587,13 @@ class ZSQLExtendFolder(Folder,Persistent elif name=="-format": format=urllib.unquote(value) elif (not (name[0]=="-" or name[0]=="_")) and (not len(value)==0): + 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) @@ -1572,7 +1577,7 @@ class ZSQLBibliography(Folder,ZSQLExtend host_port = self.REQUEST['SERVER_PORT'] fix_host = None if http_host and http_host.rfind(host_port) == -1: - print "HTTP_HOST needs fixing!" + #print "HTTP_HOST needs fixing!" fix_host = http_host + ":" + host_port ret="""