You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your query should be like db(db.my_table.id == user_id).select(orderby=~db.my_table.isCurrent | ~db.my_table.endYear | ~db.my_table.endMonth)
Tip: If you want to see the generated sql use _select db(db.my_table.id == user_id)._select(orderby=~db.my_table.isCurrent | ~db.my_table.endYear | ~db.my_table.endMonth) before run the code properly.
orderby can accept multiple fields by concatenating them with a "|". See the official web2py docs:
However when I used this code:
The return sorted the records based on isCurrent column only. The rest of the fields were ignored.
This code worked though:
The text was updated successfully, but these errors were encountered: