> -----Original Message-----
> From: sqlalchemy@googlegroups.com 
> [mailto:sqlalch...@googlegroups.com] On Behalf Of Nathan Harmston
> Sent: 30 January 2009 13:15
> To: sqlalchemy@googlegroups.com
> Subject: [sqlalchemy] Using orderedlist with a secondary table
> 
> Hi, 
> 
> I am currently trying to make a relation between Document and 
> Author, where there is a many to many association which is 
> dealt with by a secondary table and I am trying to store the 
> position of an author in the author list.
>

[snip]

>
> So is there an easy way of performing this functionality 
> using the ordered list or do I need to do something else?
> 
> Many thanks in advance
> 
> nathan
> 
> 

You can't use the 'secondary' mapper argument if you want to be able to
use columns in that secondary table. Instead, you need to map a class to
your secondary table directly, such that it has 1-many relations with
the Document and Author classes. You can then use the 'associationproxy'
extension to hide the details.

See the docs at
http://www.sqlalchemy.org/docs/05/mappers.html#association-pattern and
http://www.sqlalchemy.org/docs/05/reference/ext/associationproxy.html#as
sociationproxy

Hope that helps,

Simon

--~--~---------~--~----~------------~-------~--~----~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to