On Fri, May 24, 2019, at 12:48 PM, Jonathan Vanasco wrote:
> I agree with Simon, and I think I'm very much -1 on the usage of
> contains_eager above (and I think that ticket you linked to, Mike). I find
> that sort of stuff causes a lot of bugs in the long run.
>
> I am looking at it from this
I agree with Simon, and I think I'm very much -1 on the usage of
contains_eager above (and I think that ticket you linked to, Mike). I find
that sort of stuff causes a lot of bugs in the long run.
I am looking at it from this perspective, which is the same as Simon's but
some stronger language
On Fri, May 24, 2019, at 6:17 AM, Manoj Mokashi wrote:
> About DRY :
> If i define a join condition in a relationship, but still have to define it
> again in the queries, it seems to go against DRY.
> If the condition changes, i would have to change it everywhere. I suppose we
> could have meth
I haven't run my query, no. If that form doesn't work, try this instead:
session.query(User,
Address).outerjoin(User.addresses).filter(Address.city==city)
"Caching" is a property of the session, but it can be affected by the
transaction. By default, Session.expire_on_commit is True, so all
ca
HI Simon,
thanks or your input.
Yes, that was one question i forgot to add : how to prevent caching of
addresses in this case.
>From my experiment, one can use session.commit/rollback/expire_all or
expire(entity) specifically.
That might mean caching is related to the transactions and not session ?
(Below is just my opinion, feel free to ignore it)
I think this example goes against some of the philosophy of
SQLAlchemy, in that "User.addresses" is not really intended to be
filtered. Since a given user can only exist once in a session, if you
load that user with a filtered "addresses" property
About DRY :
If i define a join condition in a relationship, but still have to define it
again in the queries, it seems to go against DRY.
If the condition changes, i would have to change it everywhere. I suppose
we could have method like joinAddress(query) to do it in a single place.
Consider gett