On Tue, 16 Nov 2010 11:37:12 -0500
Michael Bayer <[email protected]> wrote:

> 
> On Nov 16, 2010, at 6:16 AM, Enrico Morelli wrote:
> 
> > On Mon, 15 Nov 2010 15:56:06 -0500
> > Michael Bayer <[email protected]> wrote:
> > 
> >> its looking for a Column object.    menus_table.c.weight instead of
> >> 'weight'.
> >> 
> > 
> > Thanks, I modified the query:
> > main_menu = Session.query(Menu).filter(and_(Menu.parent_id==None,
> > Menu.lang==session['lang'])).order_by(menus_table.c.weight.asc()).all()
> > 
> > but the error is the same:
> > 
> > ArgumentError: Column-based expression object expected for argument
> > 'order_by'; got: 'weight', type <type 'str'>
> 
> no , the mapping:
> 
> mapper(Menu, menus_table,
>      properties={
>          'children': relation(Menu, order_by=menus_table.c.weight),
>          'permissions': relation(Permissions, backref='menus',
>              secondary=menus_permissions_table)
>      })
> 
> 

Thank you very much.

-- 
-------------------------------------------------------------------
       (o_
(o_    //\  Coltivate Linux che tanto Windows si pianta da solo.
(/)_   V_/_
+------------------------------------------------------------------+
|     ENRICO MORELLI         |  email: [email protected]       |
| *     *       *       *    |  phone: +39 055 4574269             |
|  University of Florence    |  fax  : +39 055 4574253             |
|  CERM - via Sacconi, 6 -  50019 Sesto Fiorentino (FI) - ITALY    |
+------------------------------------------------------------------+

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to