Hello,

I'm busy to update an application to the last SQLAlchemy version.

I have to following mapped object, with a relation:

orm.mapper(Image, table.images, properties = {
    'owner' : orm.relationship(
        Participant,
        uselist = False
    )
})

In previous version of SQLAlchemy I used something like:

# >>> Image.query.options(orm.joinedload('owner')).\
      order_by(Participant.name)

Now it seems that I have to use contains_eager() too to be able to .order_by() on the relationship, is it correct ?

# >>> Image.query.outerjoin(Participant).\
      options(orm.contains_eager('owner')).\
      order_by(Participant.name)

If I understand well joinedload() always generates an anonymous alias for the joined relationship ?

Thanks,
Julien

--
No trees were killed in the creation of this message.
However, many electrons were terribly inconvenienced.

--
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.

<<attachment: jcigar.vcf>>

Reply via email to