server/sources/native.py
branchstable
changeset 6297 23c1e50ff97b
parent 6247 f7cb092d2296
child 6333 e3994fcc21c3
child 6359 0bff5a05385c
equal deleted inserted replaced
6296:b7484ae2c693 6297:23c1e50ff97b
   673                     mo = re.search('unique_cw_[^ ]+_idx', arg)
   673                     mo = re.search('unique_cw_[^ ]+_idx', arg)
   674                     if mo is not None:
   674                     if mo is not None:
   675                         index_name = mo.group(0)
   675                         index_name = mo.group(0)
   676                         elements = index_name.rstrip('_idx').split('_cw_')[1:]
   676                         elements = index_name.rstrip('_idx').split('_cw_')[1:]
   677                         etype = elements[0]
   677                         etype = elements[0]
   678                         rtypes = elements[1:]                        
   678                         rtypes = elements[1:]
   679                         raise UniqueTogetherError(etype, rtypes)
   679                         raise UniqueTogetherError(etype, rtypes)
   680                     mo = re.search('columns (.*) are not unique', arg)
   680                     mo = re.search('columns (.*) are not unique', arg)
   681                     if mo is not None: # sqlite in use
   681                     if mo is not None: # sqlite in use
   682                         rtypes = [c.strip().lstrip('cw_') for c in mo.group(1).split(',')]
   682                         rtypes = [c.strip().lstrip('cw_') for c in mo.group(1).split(',')]
   683                         etype = '???'
   683                         etype = '???'
   864             self.exception('create eid failed in an unforeseen way on SQL statement %s', sql)
   864             self.exception('create eid failed in an unforeseen way on SQL statement %s', sql)
   865             raise
   865             raise
   866         else:
   866         else:
   867             cnx.commit()
   867             cnx.commit()
   868             return eid
   868             return eid
   869 
       
   870 
   869 
   871     def add_info(self, session, entity, source, extid, complete):
   870     def add_info(self, session, entity, source, extid, complete):
   872         """add type and source info for an eid into the system table"""
   871         """add type and source info for an eid into the system table"""
   873         # begin by inserting eid/type/source/extid into the entities table
   872         # begin by inserting eid/type/source/extid into the entities table
   874         if extid is not None:
   873         if extid is not None: