On Mon, 2007-29-01 at 10:05 -0500, Karl Guertin wrote:
> On 1/29/07, Arnar Birgisson <[EMAIL PROTECTED]> wrote:
> > Sorry I don't have time to verify this, but have you tried this:
> > menus = Menu.select_by( parent_id=1, order_by='order_col' )

That one does not work. ( In case anyone else is reading this! )

> I can't remember if select_by takes additional arguments, but:
> 
> menus = Menu.select([Menu.c.parent_id == 1], order_by=['order_col'])

The above throws an error:
AttributeError: 'list' object has no attribute 'accept_visitor'

This:
menus = Menu.select( Menu.c.parent_id == 1, order_by=['order_col'])

works! However, I don't know how to add in a second selection column
there. This is no good:

menus = Menu.select( Menu.c.parent_id == 1, Menu.c.visible==1,
order_by=['order_col'])

Thanks for tips guys. SA is obviously very powerful but all the options
make the docs a bit of a heavy go!

Iain



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to