Sql sort by figured out – Documentation Day 052


For the last few days I was struggling on getting the sorting and grouping of tickets working correctly in the ticketing system I am writing. I was misusing the group by function in SQLAlchemy. in setting up my query I had sq.query.filter(my filters).group_by(filter).sort_by(filter) I found that only using the sorty by and using my group filter there ie: sq.query.filter(my filters).sort_by(filter 1, filter 2) gave me the correct output and sorting, as well it gives me a little more flexibility in sorting the tickets later.

This entry was posted in tech, vLog. Bookmark the permalink. Both comments and trackbacks are currently closed.