Comment Comment by notpushkin PonyORM does something similar in Python: select(c for c in Customer if sum(c.orders.total_price) > 1000) I love the hackiness of it. parent notpushkin 1 year ago