Include query parameters in datagrid pagination links.
Review Request #5354 — Created Jan. 30, 2014 and submitted
Include query parameters in datagrid pagination links.
The datagrid pagination links had some implementation for preserving query
parameters, but it wasn't very complete. The review board code made sure that
the "user" and "group" parameters were part of it, but that lost all the other
things like sort order and show/hide closed.I've removed the reviewboard implementation for "user" and "group" (in a
separate change) and instead generalized our existing `get_url_params_except()`
method (from `Column`). Because I hadn't realized that this method exists, I've
also included a refactor from my previous similar API change to use the new
generalized util method.Other consumers of the datagrid who set extra_context['extra_query'] will be
unaffected by this change because it will overwrite the one that this adds.Testing done:
Added a bunch of review requests, and checked that the pagination links
preserved "sort", "view", and other query parameters.Fixes bug 1155.
Added a bunch of review requests, and checked that the pagination links
preserved "sort", "view", and other query parameters.
Description | From | Last Updated |
---|---|---|
We already have a function in grids.py called get_url_params_except, which will do this and allow filtering out. It's in Column, … |
chipx86 |
- Description:
-
Include query parameters in datagrid pagination links.
The datagrid pagination links had some implementation for preserving query
parameters, but it wasn't very complete. The review board code made sure that the "user" and "group" parameters were part of it, but that lost all the other things like sort order and show/hide closed. I've removed the reviewboard implementation for "user" and "group" (in a
~ separate change) and instead added a method which preserves most of the items ~ in self.request.GET
, with the notable exception of "page". This method can be~ overridden in subclasses for more complex behavior, but that's not necessary ~ for our current grids. Other consumers of the datagrid who set ~ extra_context['extra_query']
will be unaffected by this change because it will~ overwrite the one that this adds. ~ separate change) and instead generalized our existing `get_url_params_except()` ~ method (from `Column`). Because I hadn't realized that this method exists, I've ~ also included a refactor from my previous similar API change to use the new ~ generalized util method. ~ ~ Other consumers of the datagrid who set extra_context['extra_query'] will be
+ unaffected by this change because it will overwrite the one that this adds. + + Testing done:
+ Added a bunch of review requests, and checked that the pagination links + preserved "sort", "view", and other query parameters. + + Fixes bug 1155.