Saturday, March 20, 2021

Re: load standard user settings per view

I'd store the query parameters in the user's session:

https://docs.djangoproject.com/en/3.1/topics/http/sessions/#examples

On March 19, 2021 9:56:54 AM CDT, "sebasti...@gmail.com" <sebastian.jung2@gmail.com> wrote:
Hello,

i have a addresslistview that also take parameter like pagingsize and ordering over url. For example https://localhost:8000/addresslist?pagingsize=25&ordering=Id

Now when a user get a request like https://localhost:8000/addresslist?pagingsize=25&ordering=Id then parameter ?pagingsize=25&ordering=Id is stored in a user settings cache and when next time user call https://localhost:8000/addresslist without parameter then the settings from cache is set.

How can i make this without many querys on database...

No comments:

Post a Comment