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

?_size= argument is not persisted by hidden form fields in the table filters #1194

Closed
simonw opened this issue Jan 18, 2021 · 3 comments
Closed

Comments

@simonw
Copy link
Owner

simonw commented Jan 18, 2021

Click "Apply" on https://covid-19.datasettes.com/covid/ny_times_us_counties?_size=1000&county__exact=San+Francisco&state__exact=California&_sort_desc=date#g.mark=line&g.x_column=date&g.x_type=temporal&g.y_column=cases&g.y_type=quantitative and the ?_size=1000 parameter from the URL will no longer apply on the reloaded page.

@simonw
Copy link
Owner Author

simonw commented Jan 18, 2021

Relevant code:

form_hidden_args = []
# Add currently selected facets
for arg in special_args:
if arg == "_facet" or arg.startswith("_facet_"):
form_hidden_args.extend(
(arg, item) for item in request.args.getlist(arg)
)
for arg in ("_fts_table", "_fts_pk"):
if arg in special_args:
form_hidden_args.append((arg, special_args[arg]))
if request.args.get("_where"):
for where_text in request.args.getlist("_where"):
form_hidden_args.append(("_where", where_text))

It looks like there are other arguments that may not be persisted too.

@simonw
Copy link
Owner Author

simonw commented Jan 18, 2021

Should I just blanket copy over any query string argument that starts with an underscore? Any reason not to do that?

@simonw simonw modified the milestones: Datasette Next, Datasette 0.54 Jan 24, 2021
@simonw
Copy link
Owner Author

simonw commented Jan 25, 2021

I'm going to copy across anything starting with an underscore.

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

No branches or pull requests

1 participant