SQLAlchemy: Using delete/update with a join query SQLAlchemy: Using delete/update with a join query database database

SQLAlchemy: Using delete/update with a join query


You don't have to use join for your query, you may done it somehow like

db.session.query(Post).filter(Post.user_id==current_user.id).delete()

Assuming your Post have a user_id column.

Join tables would not know which table to delete, Post or User, because it actually have a convoluted middle table constructed, and query from it.