Re: [sqlalchemy] Why is this pattern discouraged in SQLAlchemy?

2017-08-07 Thread Jinghui Niu
Thanks very much for the informative reply Mike! On Sun, Aug 6, 2017 at 9:38 PM, Mike Bayer wrote: > > > On Aug 6, 2017 8:11 PM, "Jinghui Niu" wrote: > > When reading the official SQLAlchemy documentation, I found the example > below: > > ###

[sqlalchemy] 'orphan-delete' when one ForeignKey is null on table with multiple ForeignKeys

2017-08-07 Thread Ruben Di Battista
Hello, I have a tables with two ForeignKeys. When I remove the relation on one side, SQLAlchemy sets to 'NULL' the related ForeignKey, but the related row is not considered orphaned since it hase still the other ForeignKey. Is there a way to make SQLAlchemy fulfill the `orphan-delete' cascade

[sqlalchemy] Python module : SQLALchemy + Tornado

2017-08-07 Thread Siddhant Goel
Hi everyone, I spend a lot of time working with Tornado and SQLAlchemy, so I recently wrote a small module that provides a set of helper functions to make SQLAlchemy usage easier in Tornado applications. Source code - https://github.com/siddhantgoel/tornado-sqlalchemy PyPI -

Re: [sqlalchemy] 'orphan-delete' when one ForeignKey is null on table with multiple ForeignKeys

2017-08-07 Thread Mike Bayer
On Mon, Aug 7, 2017 at 10:45 AM, Ruben Di Battista wrote: > Hello, > I have a tables with two ForeignKeys. When I remove the relation on one > side, SQLAlchemy sets to 'NULL' the related ForeignKey, but the related row > is not considered orphaned since it hase still