-
-
Notifications
You must be signed in to change notification settings - Fork 690
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
Consolidate request.raw_args and request.args #774
Comments
How about moving this functionality to the request object itself? q = request["q"] # Raises KeyError if missing, otherwise returns first
q = request.get("q", "default") # Returns first, or optional default or None
facets = request.getlist("_facet") |
Or change It's currently defined like this: datasette/datasette/utils/__init__.py Lines 756 to 766 in 3c1a605
|
I think |
Also added some unit tests for request.args
I think I want Right now it returns the full list. |
As far as I can tell the only code I've ever written that would break if I made this change is in That doesn't work against latest Datasette anyway, so I think I can safely make this change. |
I'm going to rebuild
It won't support writing, so it will effectively be immutable after you have constructed it. |
Updated documentation for |
Oh dear... it looks like https://github.com/search?q=request+raw_args+datasette&type=Code I'll fix it in mine and file pull requests against other pieces before this code gets released. |
This ensures compatibility with the next release of Datasette. See simonw/datasette#774
This ensures compatibility with the next release of Datasette. See simonw/datasette#774
request.raw_args
is not documented, and I'd like to remove it entirely.Originally posted by @simonw in #706 (comment)
I use it in a few places in other projects though, so I'll have to fix those first: https://github.com/search?q=user%3Asimonw+raw_args&type=Code
The text was updated successfully, but these errors were encountered: