In TG 2.0, if you add a paginate decorator to a controller that has already a validate decorator, like this
@validate(...)
@paginate(...)
then the controller does not get the validated parameters any more, but gets only the raw parameters instead.
If you do it the other way around,
@paginate(...)
@validate(...)
then the validate will stumble over the additional page parameter.
The first problem can be solved with the proposed fix #2302 which makes the paginate decorator much cleaner and independent of the order of the decorators. However, this does not solve the second problem.
This second problem is caused by these two lines in tg.controller:
if isinstance(controller.im_self, DecoratedController):
params.update(pylons.request.params.mixed())
Even though the paginate decorator removes the page key from params, this update statement mixes it back in, and it is passed to the controller.
Do we really need these lines? What are they good for?