sdispater / eloquent

The Eloquent ORM provides a simple yet beautiful ActiveRecord implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for all query methods in eager load conditions

sdispater opened this issue · comments

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()

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()