Diff for /ZSQLExtend/ZSQLExtend.py between versions 1.75 and 1.76

version 1.75, 2005/11/25 12:14:13 version 1.76, 2005/12/22 20:33:11
Line 438  class ZSQLExtendFolder(Folder,Persistent Line 438  class ZSQLExtendFolder(Folder,Persistent
         if not query:          if not query:
             query=self.query              query=self.query
                   
           
         if (hasattr(self,"_v_searchSQL") and (self._v_searchSQL == None)) or (not hasattr(self,"_v_searchSQL")):          if (hasattr(self,"_v_searchSQL") and (self._v_searchSQL == None)) or (not hasattr(self,"_v_searchSQL")):
                           
             self._v_searchSQL=Shared.DC.ZRDB.DA.DA("_v_searchSQL","_v_searchSQL",self.getConnectionObj().getId(),"var","<dtml-var var>")              self._v_searchSQL=Shared.DC.ZRDB.DA.DA("_v_searchSQL","_v_searchSQL",self.getConnectionObj().getId(),"var","<dtml-var var>")
                           
             self._v_searchSQL.max_rows_=max_rows              self._v_searchSQL.max_rows_=max_rows
             try:              try:
                   
                 return self._v_searchSQL.__call__(var=query)                  return self._v_searchSQL.__call__(var=query)
             except :              except :
   
                 if sys.exc_info()[0]=="Database Error":                  if sys.exc_info()[0]=="Database Error":
                     try:                      try:
                         self.getConnectionObj().manage_open_connection()                          self.getConnectionObj().manage_open_connection()
Line 454  class ZSQLExtendFolder(Folder,Persistent Line 455  class ZSQLExtendFolder(Folder,Persistent
                         zLOG.LOG("ZSQLSimpleSearch",zLOG.ERROR, '%s %s'%sys.exc_info()[:2])                          zLOG.LOG("ZSQLSimpleSearch",zLOG.ERROR, '%s %s'%sys.exc_info()[:2])
         else:          else:
             try:              try:
   
                 self._v_searchSQL.max_rows_=max_rows                  self._v_searchSQL.max_rows_=max_rows
                                   
                 return self._v_searchSQL.__call__(var=query)                  return self._v_searchSQL.__call__(var=query)
             except :              except :
   
                 if sys.exc_info()[0]=="Database Error":                  if sys.exc_info()[0]=="Database Error":
                     try:                      try:
                         self.getConnectionObj().manage_open_connection()                          self.getConnectionObj().manage_open_connection()
Line 584  class ZSQLExtendFolder(Folder,Persistent Line 587  class ZSQLExtendFolder(Folder,Persistent
             elif name=="-format":              elif name=="-format":
                 format=urllib.unquote(value)                  format=urllib.unquote(value)
             elif (not (name[0]=="-" or name[0]=="_")) and (not len(value)==0):              elif (not (name[0]=="-" or name[0]=="_")) and (not len(value)==0):
   
                 changeList.append("\""+name+"\"="+sql_quote(urllib.unquote(value)))                  changeList.append("\""+name+"\"="+sql_quote(urllib.unquote(value)))
                                   
         changeString=string.join(changeList,",")          changeString=string.join(changeList,",")
   
         queryString="UPDATE %s SET %s WHERE %s"%(table,changeString,identify)          queryString="UPDATE %s SET %s WHERE %s"%(table,changeString,identify)
                   
         self.ZSQLSimpleSearch(queryString)          self.ZSQLSimpleSearch(queryString)
Line 1572  class ZSQLBibliography(Folder,ZSQLExtend Line 1577  class ZSQLBibliography(Folder,ZSQLExtend
         host_port = self.REQUEST['SERVER_PORT']          host_port = self.REQUEST['SERVER_PORT']
         fix_host = None          fix_host = None
         if http_host and http_host.rfind(host_port) == -1:          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              fix_host = http_host + ":" + host_port
                   
         ret="""<?xml version="1.0" ?>          ret="""<?xml version="1.0" ?>

Removed from v.1.75  
changed lines
  Added in v.1.76


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>