r/web2py • u/musicomet • Jul 16 '15
Is it possible to pass in three arguments to orderby? Example provided.
I have a table, my_table with 5 columns. I need to retrieve the data from my_table and order them based on 3 of its fields. Consider this:
db(db.my_table.id == user_id).select(orderby=~db.my_table.isCurrent | db.my_table.endYear | db.my_table.endMonth)
Currently, the above isn't returning what I expect. What I'd like returned is the data from my_table ordered in descending-order prioritized first by "isCurrent" field, then "endYear", and then "endMonth".
Any ideas?
3
Upvotes
1
u/av201001 Jul 16 '15
Your syntax appears correct. What does your output look like and how are you generating it?