[sqlalchemy] Re: Track a "column FOO does not exist" bug.

2019-09-05 Thread Jonathan Vanasco
On Thursday, September 5, 2019 at 8:58:16 AM UTC-4, Riccardo Cagnasso wrote: > > I don't think so. Wouldn't postgres prevented me deleting the column if it > were? > PostgreSQL will prevent you from deleting the column if it were a CONSTRAINT, but would not necessarily notice it on a trigger

Re: [sqlalchemy] Complex Constraints in Many to Many relationships

2019-09-05 Thread Mike Bayer
I wasn't totally sure if it worked! glad i could help On Thu, Sep 5, 2019, at 12:26 PM, Michael P. McDonnell wrote: > You make it seem so easy. > > Thank you! > > On Thu, Sep 5, 2019 at 11:11 AM Mike Bayer wrote: >> __ >> >> >> On Wed, Sep 4, 2019, at 5:12 PM, Michael P. McDonnell wrote:

Re: [sqlalchemy] Complex Constraints in Many to Many relationships

2019-09-05 Thread Michael P. McDonnell
You make it seem so easy. Thank you! On Thu, Sep 5, 2019 at 11:11 AM Mike Bayer wrote: > > > On Wed, Sep 4, 2019, at 5:12 PM, Michael P. McDonnell wrote: > > Hey - > I'm again at a loss of what to google, and as this will ultimately need to > be represented in some fashion in sqlalchemy, I

Re: [sqlalchemy] Complex Constraints in Many to Many relationships

2019-09-05 Thread Mike Bayer
On Wed, Sep 4, 2019, at 5:12 PM, Michael P. McDonnell wrote: > Hey - > I'm again at a loss of what to google, and as this will ultimately need to be > represented in some fashion in sqlalchemy, I figured this is a great place to > start: > > I have a |person| table and a |team| table with a

Re: [sqlalchemy] Re: Complex Constraints in Many to Many relationships

2019-09-05 Thread Michael P. McDonnell
*bump* anything? On Wed, Sep 4, 2019 at 5:02 PM Michael P. McDonnell wrote: > So I must be missing something, but here's what I have right now: > > tournament_table = Table( > 'tournament', > Base.metadata, > Column('id', UUID(as_uuid=True), primary_key=True)) > > team_table =

Re: [sqlalchemy] Track a "column FOO does not exist" bug.

2019-09-05 Thread Mike Bayer
On Thu, Sep 5, 2019, at 7:50 AM, Riccardo Cagnasso wrote: > I have a table Activity that had a strategic_project_name column. > I removed the strategic_project_name column from the declarative definition > of the Activity table and then the strategic_project_name column from the > database

[sqlalchemy] Re: Track a "column FOO does not exist" bug.

2019-09-05 Thread Riccardo Cagnasso
I don't think so. Wouldn't postgres prevented me deleting the column if it were? Il giorno giovedì 5 settembre 2019 14:42:26 UTC+2, Steven James ha scritto: > Do you have a trigger or a constraint that references that column? -- SQLAlchemy - The Python SQL Toolkit and Object Relational

[sqlalchemy] Track a "column FOO does not exist" bug.

2019-09-05 Thread Steven James
Do you have a trigger or a constraint that references that column? -- 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

[sqlalchemy] Track a "column FOO does not exist" bug.

2019-09-05 Thread Riccardo Cagnasso
I have a table Activity that had a strategic_project_name column. I removed the strategic_project_name column from the declarative definition of the Activity table and then the strategic_project_name column from the database itself. Now I get this error message every time I try to update the

Re: [sqlalchemy] Distinct within group by query

2019-09-05 Thread Andrew M
Yes, I'm using Postgres. This does exactly what I need: session.query(Product.attribute_x, func.min(Product.price), func.array_agg(func.distinct(Product.color))).group_by(Product.attribute_x) Thanks Varun, that's saved me a real headache. I appreciate your help. -- SQLAlchemy - The Python