Changeset 1799


Ignore:
Timestamp:
26.01.2012 16:25:22 (4 weeks ago)
Author:
fhoffmann
Message:

SQL-Model-Mapper patched for SQLite handling of quotation marks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/zmssqldb.py

    r1745 r1799  
    187187      container = self.getModelContainer() 
    188188      container_xml = container.raw 
    189       model_xml =  getattr(self,'model_xml','<list>\n</list>') 
     189      model_xml =  getattr(self,'model_xml',None) 
     190      if model_xml is None: 
     191        model_xml = '<list>\n</list>' 
     192        self.model_xml = model_xml 
     193        self.model = [] 
    190194      if container_xml != model_xml: 
    191195        self.model_xml = container_xml 
     
    446450      except: 
    447451        pass 
     452      print "getEntities" 
    448453       
    449454      entities = [] 
     
    486491                      if len(l) > 0: 
    487492                        c += l + ' ' 
    488                     if c.startswith('"') and c.find(' ') > 0: 
    489                       col = {} 
    490                       col["id"] = str(c[1:c.find(' ')-1]) 
    491                       col["description"] =str(c[c.find(' ')+1:]) 
    492                       columnBrwsrs.append(col) 
     493                    cl = filter(lambda x: len(x.strip()) > 0, c.split(' ')) 
     494                    if len(cl) >= 2: 
     495                      cid = cl[0] 
     496                      if cid.startswith('"') and cid.endswith('"'): 
     497                        cid = cid[1:-1] 
     498                      ucid = cid.upper()  
     499                      uctype = cl[1].upper() 
     500                      if not ucid == 'CHECK' and not uctype=='KEY' and not uctype.startswith('('): 
     501                        col = {} 
     502                        col["id"] = cid 
     503                        col["description"] = ' '.join(cl[1:]) 
     504                        columnBrwsrs.append(col) 
    493505              else: 
    494506                for columnBrwsr in tableBrwsr.tpValues(): 
Note: See TracChangeset for help on using the changeset viewer.