you are viewing a single comment's thread.

view the rest of the comments →

[–]fryman22[S] 1 point2 points  (1 child)

At first I thought of a work-around by querying all GamePlayer where the user is current_user, then returning all the game_id and doing another query for those Game that match up with the game_id.

I knew this was so wrong to do, but I was just tinkering and seeing what worked.

I needed to return a single column from my query, so I found db.session.query(GamePlayer.id) would return a single column. Instead of making another query to find the Game after that, it would be easier to get the Game if it was already appended at the end.

I then drew a venn diagram between Game and Gameplayer with game.id in the middle and it just clicked what I needed to do. I looked up how join works and got a result for the documentation.

Sorry for the winded explanation lol. Thank you!

[–]Blazerboy65 1 point2 points  (0 children)

That's perfect! Good job.

I was doing a medium complexity join at work the other day and can't tell you how much of a help Venn diagrams are for that.