[sqlalchemy] SQLAlchemy 1.3.23 turn off before_compile with **kwargs?

2021-03-01 Thread Chris Simpson
Hello I'd like to understand how to turn off a before_compile listener (e.g. soft delete, to include deleted items). For example, I've adapted the example from the docs: https://docs.sqlalchemy.org/en/13/orm/events.html?highlight=before_compile#sqlalchemy.orm.events.QueryEvents.before_compile

Re: [sqlalchemy] Re: SQLAlchemy join/has query with example code

2021-02-09 Thread Chris Simpson
Thanks Mike, the assurance it's the right idea was what I wanted to check. All sorted much appreciated. On Sun, 7 Feb 2021, 21:49 Mike Bayer, wrote: > > > On Sat, Feb 6, 2021, at 8:56 AM, Chris Simpson wrote: > > After posting, I have arrived at *a* solution (which might be

[sqlalchemy] Re: SQLAlchemy join/has query with example code

2021-02-06 Thread Chris Simpson
an.id==PlanRequirements.plan_id)\ .filter(PlanRequirements.subscription==1).all() Kind regards, Chris On Saturday, 6 February 2021 at 13:42:54 UTC Chris Simpson wrote: > Hello, > > I'm trying to convert this working SQL query: (SQLAlchemy models are below) > > SELECT COUN

[sqlalchemy] SQLAlchemy join/has query with example code

2021-02-06 Thread Chris Simpson
Hello, I'm trying to convert this working SQL query: (SQLAlchemy models are below) SELECT COUNT(*) FROM person JOIN subscription ON person.id = subscription.person_id JOIN plan ON subscription.sku_uuid = plan.uuid JOIN plan_requirements ON plan.id = plan_requirements.plan_id WHERE plan_requireme