Another rookie question, and sorry if I've titled it awkwardly.  My
User object has a one-to-many relation to an Account object. The
relation is defined with 'accounts = relation("Account")' . As I
understand it, given an instance of User, this lets me easily get to
his accounts with user.accounts; I can iterate through it, etc.

However, I don't understand how I can find an Account in that list
that meets specified criteria, or filter that list in some other way.
I can do a separate query like 'session.query(Account).filter
(Account.user_id == user.id).filter(some-other-criteria), but that
doesn't seem very ORM-y, since my User already "has" a list of
Accounts that, it seems, I should be able to look through
intelligently.

I'd very much appreciate any help or enlightenment the group can
offer. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to