On Feb 26, 2010, at 10:20 AM, Marcin Krol wrote:

> Alexandre Conrad wrote:
>> 2010/2/26 Marcin Krol <mrk...@gmail.com>:
>>> mapper(City, city_table, properties={'users':relation(User,
>>> order_by='user_.id', backref='city_backref')})
> 
> Fixed, I should have specified order_by in a different manner:
> 
> mapper(User, user_table, properties={'usercity':relation(City, 
> order_by=city_table.c.id, backref='user_backref')})
> 
> mapper(City, city_table, properties={'users':relation(User, 
> order_by=user_table.c.id, backref='city_backref')})
> 
> 
> Was the notation: relation(... order_by='tablename.columnname') ever 
> supported by SQLAlchemy or my memory is playing me a trick?

That is a feature of declarative.

> 
> Note that SQA didn't complain about this notation until I used eagerload..

a String can be resolved to a SQL expression without issue, and relation has no 
problem with it.  eagerload() however needs more information than this since it 
has to do aliasing - the string expressions are skipped.    If someone would 
like to submit a simple one line patch that emits a warning here I will accept 
it (line 783 of orm/properties.py).



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

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