How to put common validation to all views?
The simplest approach is to perform that check when setting/computing request.page_size.
I have view_xx.py and view_yy.py and I also have a common views.py.
I want to put a validation for checking that request.page_size is less than or equal to request.registry.settings["max_page_size"].
How do I do this?
Is it possible using contexts in a common views.py file?
I am not sure how to put a context such that it first goes to view_xx.py depending on URL and then goes to common views function to validate page size and then again comes back to the view_xx.py view for further steps.