Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

sqlalchemy integrityerror

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import exc

db = SQLAlchemy(Flask(__name__))

try:
     db.session.add(resource)
     return db.session.commit()
except exc.IntegrityError:
     db.session.rollback()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sqlalchemy #integrityerror
ADD COMMENT
Topic
Name
2+1 =