mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_filter_column=col&_filter_op=op&_filter_value=value redirect
Part of implementing the filters UI (refs #86) - the following: /trees/Trees?_filter_column=SiteOrder&_filter_op=gt&_filter_value=2 Now redirects to this; /trees/Trees?SiteOrder__gt=2
This commit is contained in:
parent
ddc808f387
commit
386fb11d42
3 changed files with 53 additions and 6 deletions
|
|
@ -120,9 +120,17 @@ def validate_sql_select(sql):
|
|||
|
||||
|
||||
def path_with_added_args(request, args):
|
||||
current = request.raw_args.copy()
|
||||
current.update(args)
|
||||
return request.path + '?' + urllib.parse.urlencode(current)
|
||||
current = {
|
||||
key: value
|
||||
for key, value in request.raw_args.items()
|
||||
if key not in args
|
||||
}
|
||||
current.update({
|
||||
key: value
|
||||
for key, value in args.items()
|
||||
if value is not None
|
||||
})
|
||||
return request.path + '?' + urllib.parse.urlencode(sorted(current.items()))
|
||||
|
||||
|
||||
def path_with_ext(request, ext):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue