Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_where= parameter is not persisted in hidden form fields #604

Closed
simonw opened this issue Oct 21, 2019 · 3 comments
Closed

_where= parameter is not persisted in hidden form fields #604

simonw opened this issue Oct 21, 2019 · 3 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Oct 21, 2019

e.g. on this page: https://v0-30.datasette.io/fixtures/roadside_attractions?_where=name%20like%20%27%museum%%27

Click the "Apply" button and the _where= parameter will be dropped.

@simonw simonw added the bug label Oct 21, 2019
@simonw
Copy link
Owner Author

simonw commented Oct 25, 2019

Relevant code:

{% for key, value in form_hidden_args %}
<input type="hidden" name="{{ key }}" value="{{ value }}">
{% endfor %}
<input type="submit" value="Apply">

And

form_hidden_args = []
for arg in ("_fts_table", "_fts_pk"):
if arg in special_args:
form_hidden_args.append((arg, special_args[arg]))

@simonw
Copy link
Owner Author

simonw commented Oct 25, 2019

Just adding _where to that tuple won't do the trick, because _where= can be passed multiple times, e.g. https://latest.datasette.io/fixtures/roadside_attractions?_where=name%20like%20%27%museum%%27&_where=address%20like%20%27%Drive%%27

@simonw simonw closed this as completed in e2c3905 Oct 30, 2019
@simonw
Copy link
Owner Author

simonw commented Oct 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant