On Apr 3, 12:39 pm, Alexandre CONRAD <[EMAIL PROTECTED]> wrote:
>
> And I'd like to find all "attachments" from one client. But as there's a
> weak (secondary) table in between, I can no longer have something like:
>
>    model.Attachment.id_client==c.client.id
>
> How can I achieve this ?

using a criterion like
and_(Attachment.c.attachment_id==attachment_has_clients.c.id_attachment,
attachment_has_clients.c.id_client=Client.c.cllient_id)

or you could use the built in stuff:

session.query(Attachment).filter_by(clients=someclient).list()

>
> ps: I'm using assign_mapper.
>
> Regards,
> --
> Alexandre CONRAD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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