Replies: 1 comment
-
Yes. This is the preferred solution, meets all of your requirements as far as I can discern, and is efficient. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I have no choice but needing to support query parameters that start with dollar signs
$
which means I can't access those segments in the convenient way since I end up without a valid identifier.So far I've gotten around that with
Request.get_query_value
in aFromRequest
, and I see that in the latest release it looks likeRequest.query_value
is the next variant of that.My latest problem is that I need get these query parameters case insensitively, which isn't possible with either of those two standalone functions above. Plus I see the warning in the docs of how this is not an efficient way of pulling these query parameters which totally makes sense.
Another way I've gotten around this is with
FromForm
which I imagine probably has a similar effect on efficiency as the other method since I have to iterate over all query parameters to grab the ones I require. I haven't tried the latest version variant ofFromForm
yet, but on the surface I'm not sure that it is a viable solution anymore.This does solve my case insensitivity problem (in v0.4 at least) but still requires me to iterate over all query parameters.
Ideally I'd really love to have a way to basically rename a query parameter segment so that I can capture these special symbols. Whether that is in the URL string or a separate decorator like one of the following (I have no preferences on syntax):
If there is no way of doing the above, then it would at least be nice to have a version of
Request.query_value
that could take a closure instead of a string so that I could do my own case insensitive string matching.I think I'd be able to figure out adding a new
Request.query_value
that takes a closure instead of value, but the other solution is really what I'd prefer.FromForm
going to be possible in the latest version?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions