mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_filter_column=col&_filter_op=isnull__1 redirect
if filter_op contains a __ the value is set to the right hand side.
e.g.
?_filter_column=col&_filter_op=isnull__1&_filter_value=x
Redirects to:
?col__isnull=1
Refs #86
This commit is contained in:
parent
386fb11d42
commit
a5881e105a
2 changed files with 12 additions and 0 deletions
|
|
@ -431,6 +431,8 @@ class TableView(BaseView):
|
|||
filter_column = special_args['_filter_column']
|
||||
filter_op = special_args.get('_filter_op') or ''
|
||||
filter_value = special_args.get('_filter_value') or ''
|
||||
if '__' in filter_op:
|
||||
filter_op, filter_value = filter_op.split('__', 1)
|
||||
return self.redirect(request, path_with_added_args(request, {
|
||||
'{}__{}'.format(filter_column, filter_op): filter_value,
|
||||
'_filter_column': None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue