Basically, just do this:
orm.mapper(Order, order)
Order.items = association_proxy('order_items', 'items')
The association proxy is independent of the declarative system and if
you look in early documentation you'll see it described in terms of
classical mapping.
As far as the term "without touching the classes", there's not much
point trying to be purist about this as the call to mapper(Order,
order) highly alters the Order class in any case.
>
> Thanks,
>
> PS: You find this same question on SO, if you want you can answer also
> there.
>
>
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
>
http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See
http://stackoverflow.com/help/mcve for a full
> description.
> ---
> 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
sqlalchemy+...@googlegroups.com.
> To post to this group, send email to
sqlal...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/sqlalchemy.
> For more options, visit
https://groups.google.com/d/optout.