Re: [sqlalchemy] orm.relationship() with dynamic part ?

2018-04-09 Thread Julien Cigar
On Thu, Apr 05, 2018 at 12:26:32PM -0400, Mike Bayer wrote: > you can do a bindparam with a callable, which I *think* should work here: > > ContentTranslation.language_id == bindparam(None, callable_=lambda: > get_current_request().locale_name) > > you want to set bake_queries=False on this

Re: [sqlalchemy] orm.relationship() with dynamic part ?

2018-04-05 Thread Mike Bayer
you can do a bindparam with a callable, which I *think* should work here: ContentTranslation.language_id == bindparam(None, callable_=lambda: get_current_request().locale_name) you want to set bake_queries=False on this relationship(). if it doesn't work, there's other ways to do this too.