Re: [sqlalchemy] three table join with confusing results

2018-06-01 Thread chbrnola
Simon, Think I figured out the issue, but no idea how to solve for it. In the DB I was using the Groups has a foreign key I didn't think was importnant and didn't include in the trimmed down example. So I was very confused when writing the file that the issue didn't repeat until I compared

Re: [sqlalchemy] three table join with confusing results

2018-06-01 Thread chbrnola
Simon, Will put a standalone script together, I'm using Flask-SQLAlchemy so it might vary some from standard SQLAlchemy, I'll post it in a few minutes, thanks! Carl On Friday, June 1, 2018 at 8:51:32 AM UTC-5, Simon King wrote: > > What does the SQL look like for each of your queries? > > Can

Re: [sqlalchemy] three table join with confusing results

2018-06-01 Thread Simon King
What does the SQL look like for each of your queries? Can you produce a standalone script that demonstrates the problem? You could use my script from https://groups.google.com/forum/#!topic/sqlalchemy/GNIBQMvMRg8 as a template. Thanks, Simon On Fri, Jun 1, 2018 at 2:41 PM wrote: > > I'm

[sqlalchemy] three table join with confusing results

2018-06-01 Thread chbrnola
I'm trying to join three tables in SQLAlchemy and while it works on joining and filtering with two of the tables the third one it only returns an arbitrary row (always the same one for some reason) and I'm completely confused about this behavior. Table classes: class Users(db.Model):