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

2019-09-06 Thread Jonathan Vanasco
You should (probably) also add the "person" to "team_tournament" for the added benefit that a person may switch teams between tournaments (or not play in one), so tracking participation with a triplet is a chunk of useful data. Mike's approach with indexes is definitely the straightforward bes

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 fig

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 m

[sqlalchemy] Complex Constraints in Many to Many relationships

2019-09-04 Thread Michael P. McDonnell
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 many to many table in between |team_person|. Simple enough! Now - to make it f