Eg : 1
1 2 3 4 5 6 7 8 | def delete(self): titles = request.POST.getall('title') pages = self.page_q.filter(Page.title.in_(titles)) for page in pages: Session.delete(page) Session.commit() redirect_to('pages') |
Eg : 2
1 2 3 4 | from sqlalchemy import delete d = delete(page_table, page_table.c.id==1) connection.execute(d) |