Diff for /ZSQLExtend/ZSQLExtend.py between versions 1.74 and 1.77

version 1.74, 2005/11/23 17:41:28 version 1.77, 2005/12/22 21:10:34
Line 67  class ZSQLExtendFolder(Folder,Persistent Line 67  class ZSQLExtendFolder(Folder,Persistent
     """Folder"""      """Folder"""
     meta_type="ZSQLExtendFolder"      meta_type="ZSQLExtendFolder"
           
       def ZSQLQuote(self,str):
           """quote str for sql"""
           return sql_quote(str)
       
       
     def importXMLFile(self,table,containerTagName,file,identify=None,RESPONSE=None):      def importXMLFile(self,table,containerTagName,file,identify=None,RESPONSE=None):
         #TODO: finish importXMLFile          #TODO: finish importXMLFile
         '''          '''
Line 427  class ZSQLExtendFolder(Folder,Persistent Line 432  class ZSQLExtendFolder(Folder,Persistent
         return self.ZSQLSimpleSearch(query)          return self.ZSQLSimpleSearch(query)
           
           
       def ZSQLResetConnection(self):
           """reset the connectione"""
           try:
               self.getConnectionObj().manage_close_connection()
           except:
               zLOG.LOG("ZSQLResetConnection",zLOG.ERROR, '%s %s'%sys.exc_info()[:2])
           try:
               self.getConnectionObj().manage_open_connection()
           except:
               zLOG.LOG("ZSQLResetConnection",zLOG.ERROR, '%s %s'%sys.exc_info()[:2])
   
     def ZSQLSimpleSearch(self,query=None,max_rows=1000000):      def ZSQLSimpleSearch(self,query=None,max_rows=1000000):
         """simple search"""          """simple search"""
                   
         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 449  class ZSQLExtendFolder(Folder,Persistent Line 466  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 579  class ZSQLExtendFolder(Folder,Persistent Line 598  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 1567  class ZSQLBibliography(Folder,ZSQLExtend Line 1588  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.74  
changed lines
  Added in v.1.77


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