yes
sort=db.table.id|db.table.otherfield|~db.table.yetanotherfield
records=db().select(db.table.ALL,orderby=sort)
or using war SQL (not nice but possible)
sort="table.id, table.otherfield, table.yetanotherfield DESC"
records=db().select(db.table.ALL,orderby=sort)
Notice in the second case there is no "db." because the connection
exist in Python not in SQL.
Massimo
>
On Dec 8, 11:08 pm, Cory Coager <[EMAIL PROTECTED]> wrote:
> Is it possible to dynamically create a sql object to be used in the
> orderby field?
>
> Example:
> sort="db.table.id"
> records=db().select(db.table.ALL,orderby=sort)
>
> Gives error:
> ProgrammingError: schema "db" does not exist
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---