I have a Person class and a Names class, which have a one-to-many 
relationship ( a person can have many names ).

After doing a query like this:

> p = session.query(Person).filter(Person.birthday > "1992-01-01").one()
>

I'd like to further perform a query on the returned object p to select only 
its names that starts with letter "B".

Currently I am using a very basic way of looping(by the way I'm using 
automap bases, which is cool!) :

> for n in p.names_collection:
>     if n.startswith('B'):
>         names.append(n)
>

I'm wondering if there is some sqlalchemy-specific ways of querying an 
attributes on a returned object? Just need a hint here, I can do the 
research following the lead. Many thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to