Re: [sqlalchemy] Re: Can't access model object backref

2013-01-25 Thread Michael Bayer
You need to join to Category.parent first.  It also must be aliased, because 
this is self-referential:

ca = aliased(Category)

query(Category).join(ca,  Category.parent).order_by(ca.name, Category.name)




On Jan 25, 2013, at 3:49 PM, sector119 wrote:

> I want to order_by(Category.parent.name, Category.name) is it possible?
> 
> -- 
> 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.
> Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sqlalchemy] Re: Can't access model object backref

2013-01-25 Thread sector119
I want to order_by(Category.parent.name, Category.name) is it possible?

-- 
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.
Visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.