[PonyORM-list] select() and Cannot iterate over non-entity Object

Niklas Rosenstein rosensteinniklas at gmail.com
Tue Nov 18 18:31:48 UTC 2014


I try to use  pony.orm.select()  like this, where  User.accounts  is a Set
for the Entity "Account".

user = User[1]
print(select(a for a in user.accounts if a.label == 'label'))

The solution to it would be

user = User[1]

print(select(a for a in Account if a.user == user and a.label == 'label'))

I would much rather write the first version. Is this a limitation of Pony

Python 3.4.1
Pony ORM 0.6

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </ponyorm-list/attachments/20141118/6551afa2/attachment.html>

More information about the ponyorm-list mailing list