[PonyORM-list] The docs don't seem to cover this query type
matthewrobertbell at gmail.com
Sun Feb 16 13:26:14 UTC 2014
Say I have 2 entities with a one to many relationship:
bs = set('B')
a = Required('A')
status = Required(unicode)
I then want to query for all "A", that have Bs that all have the status
How I assumed it could be done:
select(a for a in A if a.bs.status == 'whatever')
select(a for a in A if all(b.status == 'whatever' for b in a.bs))
But neither work. What is the "pony way" of doing this?
A python example of what I mean (I obviously would like to do it properly
all in pony though):
for a in models.A.select():
if all(b.status == 'whatever' for b in a.bs):
Thanks in advance for any guidance.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ponyorm-list