[sqlalchemy] can't delete object (AssertionError: Dependency rule tried to blank-out primary key column)

2014-11-05 Thread Jonathan Vanasco
This error doesn't make sense to me: foo = dbSession.query(Foo).options(joinedload('bar')) dbSession.delete(foo.bar) dbSession.flush() dbSession.delete(foo) dbSession.flush() I'm getting the AssertionError on the `.delete(foo)`, but I've already deleted/flushed foo.bar --

Re: [sqlalchemy] boolean column_property using exists

2014-11-05 Thread Michael Bayer
so you want to embed an exists() into column_property(), and the way to make an exists() is at http://docs.sqlalchemy.org/en/rel_0_9/core/selectable.html?highlight=exists#sqlalchemy.sql.expression.exists

[sqlalchemy] boolean column_property using exists

2014-11-05 Thread Kevin S
I've seen slight variations on this topic, but not exactly what I'm looking for. I want to use a column_property (or something like it) to map the existence of some Child relationship. Say for example, I have two summary pages in a web app. One for displaying rows of Parent objects, and one fo

Re: [sqlalchemy] behavior of multiple correlated subqueries different from 0.7.10 to 0.9.8

2014-11-05 Thread Michael Bayer
this issue is fixed in the 0.9 and 1.0 branches, https://bitbucket.org/zzzeek/sqlalchemy/issue/3241/multiple-anonymous-expressions-in-query . > On Nov 5, 2014, at 3:33 AM, Michael Bayer wrote: > >> >

Re: [sqlalchemy] behavior of multiple correlated subqueries different from 0.7.10 to 0.9.8

2014-11-05 Thread Michael Bayer
> On Nov 4, 2014, at 10:47 PM, Meelap Shah wrote: > > > With 0.9.8, the str(query) is the same with User having been dropped from > subqueries, but the error output shows a different subquery being executed > that selects from both Action and User. the error output here is just showing the “