_sort and _sort_desc parameters for table views

Allows for paginated sorted results based on a specified column.

Refs #189
This commit is contained in:
Simon Willison 2018-04-08 17:06:10 -07:00 committed by Simon Willison
commit f3a3820ff5
5 changed files with 146 additions and 24 deletions

View file

@ -29,9 +29,10 @@ reserved_words = set((
).split())
def compound_pks_from_path(path):
def urlsafe_components(token):
"Splits token on commas and URL decodes each component"
return [
urllib.parse.unquote_plus(b) for b in path.split(',')
urllib.parse.unquote_plus(b) for b in token.split(',')
]