Support for all query methods in eager load conditions
sdispater opened this issue · comments
Sébastien Eustace commented
Eager load conditions support where queries. It should support all query methods instead.
users = User.with_({'posts': Post.query().order_by('created_at', 'desc')}).get()
Sébastien Eustace commented
To make things easier, eager load conditions will support callbacks. Therefore, only wheres will be supported when passing a query.
users = User.with_({
'posts': lambda q: q.where('title', 'like', 'foo%').order_by('created_at', 'desc')
}).get()