Hi there,

I have a principal object (Person) with another group of objects
(Address) grafted on through the properties={ 'addresses' :
relation(Address, secondary = ...)} functions in the mappers

I want to select all Person objects that have particular joined
objects (i.e. select by joined object's 'id')

If my principal object did not have the 'id' method I could just use

results = model.People.select_by(id=3)

However it does have the id property. I try

query_address = model.Address()
query_address.id = '13 Cemetary Road'
results = model.People.select_by(addresses = query_address)

However this only works if _all_ object properties match

Finally I try

results = model.People.select_by(model.address_table.c.id==3)

But this (weirdly) returns _all_ People entries in my table regardless
of what Address they have.

What method can I use within the ORM side of things to search the
joined objects?

Brendan

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to