714 # so drop the prefix, split on comma, drop the tablenames, and drop "cw_" |
714 # so drop the prefix, split on comma, drop the tablenames, and drop "cw_" |
715 columns = arg.split(':', 1)[1].split(',') |
715 columns = arg.split(':', 1)[1].split(',') |
716 rtypes = [c.split('.', 1)[1].strip()[3:] for c in columns] |
716 rtypes = [c.split('.', 1)[1].strip()[3:] for c in columns] |
717 raise UniqueTogetherError(cnx, rtypes=rtypes) |
717 raise UniqueTogetherError(cnx, rtypes=rtypes) |
718 |
718 |
719 mo = re.search('"cstr[a-f0-9]{32}"', arg) |
719 mo = re.search(r'\bcstr[a-f0-9]{32}\b', arg) |
720 if mo is not None: |
720 if mo is not None: |
721 # postgresql |
721 # postgresql |
722 raise ViolatedConstraint(cnx, cstrname=mo.group(0)[1:-1]) |
722 raise ViolatedConstraint(cnx, cstrname=mo.group(0)) |
723 if arg.startswith('CHECK constraint failed:'): |
723 if arg.startswith('CHECK constraint failed:'): |
724 # sqlite3 (new) |
724 # sqlite3 (new) |
725 raise ViolatedConstraint(cnx, cstrname=arg.split(':', 1)[1].strip()) |
725 raise ViolatedConstraint(cnx, cstrname=arg.split(':', 1)[1].strip()) |
726 mo = re.match('^constraint (cstr.*) failed$', arg) |
726 mo = re.match('^constraint (cstr.*) failed$', arg) |
727 if mo is not None: |
727 if mo is not None: |