Open moellering opened 4 years ago
This security mechanism/pattern has been copied from DRF. They also do it like so.
What about adding pagination_class = ProductListPagination
to CMSPageCatalogWrapper
? This then would be consistent with the current approach.
Please try the latest master branch. There I added a my proposal from above. If that works for you, I'll release a new version.
Problem
I'm trying to overwrite the default_limit on the ProductListPagination. To do that I have created a derived class
However, passing there is no easy option to set the pagination class in the cms_apps.py (e.g. via
CMSPageCatalogWrapper.as_view(pagination_class=BiggerProductListPagination)
).Workaround
My workaround is currently deriving from CMSPageCatalogWrapper and overwriting the
as_view
method:Ideas
Not sure if we could modify just pass all attributes to the list_view and search_view type creations. This would enable us to set all list_view and search_view attributes via the
as_view
method ofCMSPageCatalogWrapper
used when setting urls.