Re: [sqlalchemy] relationship joined to max() on a foreign table - help needed

2016-04-26 Thread Mike Bayer
On 04/26/2016 08:09 AM, Rob Fowler wrote: I have a complete example here: https://gist.github.com/mianos/42cf15928f27cc9dfde9996d2e593e78 Ideas? I am sure it's possible. At the moment I am just using a "orderby desc" on the relationship and using [0] to get the first. this example helps

[sqlalchemy] relationship joined to max() on a foreign table - help needed

2016-04-26 Thread Rob Fowler
Can anyone help me with this interesting (to me) relationship definition in sqla. I have some already defined data, not by me, that has, for each user, a foreign table of contact numbers, where the highest contact number is the one to use. For example, users: Harry, 1081, and Bob 1082