Closed g4b1nagy closed 9 years ago
According to http://docs.sqlalchemy.org/en/rel_1_0/orm/query.html#sqlalchemy.orm.query.Query.delete, query.delete() "does not offer in-Python cascading of relationships", which essentially means that trying to delete such an object from Flask-SuperAdmin results in an IntegrityError.
I suggest using the session.delete(object) method, as this also takes into account any relationships defined in the SQLAlchemy models.
Please let me know what you think and last but not least, thank you :)
PS: I am using Flask-SuperAdmin==1.7.1 SQLAlchemy==1.0.0
According to http://docs.sqlalchemy.org/en/rel_1_0/orm/query.html#sqlalchemy.orm.query.Query.delete, query.delete() "does not offer in-Python cascading of relationships", which essentially means that trying to delete such an object from Flask-SuperAdmin results in an IntegrityError.
I suggest using the session.delete(object) method, as this also takes into account any relationships defined in the SQLAlchemy models.
Please let me know what you think and last but not least, thank you :)