@robhudson: The name _query_ is what confused me and lead to a bug.
_query_ is actually a dict from the form cleaned_values. That form comes from the URL and treats the query params and I guess that's why it's called _query_.
I have to test:
- if appver is in the request.GET: use it. If it's blank, it means any app version.
- if appver is not in request.GET, use the session.
Note that we cannot rely on the presence of query['appver'] as it is always present (and that was the tricky part that made the bug appear) and could have a default or modified value from the form. Why not use the appver directly from the request.GET? Because the form makes a cleaning onto the value and outputs the _query_ dict.