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 = Table(

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

2019-09-04 Thread Michael P. McDonnell
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 = Table( 'team', Base.metadata, Column('id', UUID(as_uuid=True), primary_key=True, *C

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

2019-09-04 Thread Derek Lambert
If I'm understanding correctly... You're on the right track. I'd use a composite primary key on |team_person|, consisting of foreign keys from |person| and |team|, and another composite key (or unique index) on the |team| to |tournament| table. This lets the database do all the work. -Derek O