[sqlalchemy] Re: recipe advice for special 1:1 relationships

2019-04-04 Thread Kent
Excellent, thanks very much! -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You

Re: [sqlalchemy] Re: recipe advice for special 1:1 relationships

2019-04-04 Thread Mike Bayer
DELETEs are always by primary key, and you'll want to set up the cascade="all,delete-orphan" and youll need single_parent=True also. On Thu, Apr 4, 2019 at 11:55 AM Kent wrote: > > Will > > a.b1 = None > > > issue a delete statement that also contains the WHERE clause to make that > safe? (Or,

[sqlalchemy] Re: recipe advice for special 1:1 relationships

2019-04-04 Thread Kent
Will a.b1 = None issue a delete statement that also contains the WHERE clause to make that safe? (Or, is the delete always by primary key anyway?) -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: