[sqlalchemy] Re: New problem with synonym (getter/setter) use in 0.5.2

2009-02-04 Thread Michael Bayer

its not really a bug.   use real column objects for your order by  
expression, i.e.:

order_by=_username,

this is because when using declarative, string arguments used in  
relation()/backref() where there are ordinarily class or SQL  
expression objects are interpreted to be part of the registry of  
declared classes.

Even in previous versions of SQLA or without using declarative, you  
dont want to put order_by='somecolname' in relation()/backref() - it  
prevents SQLAlchemy from aliasing that order by in the case of any  
kind of aliased join, subquery, or eager load.


On Feb 4, 2009, at 1:07 AM, Ken wrote:


 This seems to have just come up after upgrading from 0.5.0rc4.

 Create a MySQL database (may happen with other engines?) called test
 and run this simple script to reproduce:

 http://dpaste.com/116443/

 One gets this traceback:

 http://dpaste.com/116444/

 It's happening because in backref, I'm specifying an orderby of
 'username'. I also tried '_username' but that also fails. Thoughts?
 


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



[sqlalchemy] Re: New problem with synonym (getter/setter) use in 0.5.2

2009-02-04 Thread Ken

On Feb 4, 6:53 am, Michael Bayer mike...@zzzcomputing.com wrote:
 its not really a bug.   use real column objects for your order by  
 expression, i.e.:

 order_by=_username,

Oh, that makes sense. Thanks for the explanation.

-Ken

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



[sqlalchemy] Re: New problem with synonym (getter/setter) use in 0.5.2

2009-02-03 Thread Ken

Oh, sorry, forgot to mention:

Python 2.5.2
SQLAlchemy 0.5.2

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