[sqlalchemy] Re: Using order_by in an association many-to-many relationship with columns from the association object

2009-03-11 Thread Scott
When I do this... cpt_codes = ManyToMany( ... order_by = procedure_cpt_codes.c.cpt_codes_idx ) # procedure_cpt_codes is the JOIN table in between the parent (procedure) --- children (cpt_codes) # procedure_cpt_codes has 3 columns...procedure_id (foreign key), cpt_code_id (foreign key) and

[sqlalchemy] Re: Using order_by in an association many-to-many relationship with columns from the association object

2009-03-11 Thread Michael Bayer
On Mar 11, 2009, at 6:17 PM, Scott wrote: When I do this... cpt_codes = ManyToMany( ... order_by = procedure_cpt_codes.c.cpt_codes_idx ) # procedure_cpt_codes is the JOIN table in between the parent (procedure) --- children (cpt_codes) # procedure_cpt_codes has 3

[sqlalchemy] Re: Using order_by in an association many-to-many relationship with columns from the association object

2009-03-10 Thread Michael Bayer
order_by accepts a Column object, i.e. table.c.whatever, so pass that in. Scott wrote: Is there a way with the current iteration of SQLAlchemy to add a column to the association table in a many-to-many relationship with that column used to order the join? I looked at the order_by attribute