[sqlalchemy] Re: Filtering by an attribute of a related class (abusing generative filters...)

2009-02-28 Thread Michael Bayer
On Feb 27, 2009, at 3:10 PM, Ben Zealley wrote: Hi all, I've got a requirement that seems like it should be fairly straightforward, but my own attempts to work out the necessary code have just become more and more contrived, and still don't work :( so I'm hoping someone more familiar

[sqlalchemy] Re: Filtering by an attribute of a related class (abusing generative filters...)

2009-02-28 Thread Ben Zealley
Hi Michael, Thanks for the quick response! I had no luck with has()/any() mostly because I didn't have the attribute per se, just its (string) name - but I've rather belatedly realised I can just use modelClass.__dict__[attr].any(), which works like a charm. I'll consider the functional

[sqlalchemy] Re: Filtering by an attribute of a related class (abusing generative filters...)

2009-02-28 Thread Michael Bayer
On Feb 28, 2009, at 12:26 PM, Ben Zealley wrote: Hi Michael, Thanks for the quick response! I had no luck with has()/any() mostly because I didn't have the attribute per se, just its (string) name - but I've rather belatedly realised I can just use modelClass.__dict__[attr].any(), which