I am new to Django and this is my first question, so apologies up front if the answer is obvious.
I have a large number of transactions that I am displaying using a cbv ListView, paginated by 10. Each transaction is editable using an UpdateView. If I am on say page 50, edit a record and then I submit it, I return to my ListView, but always on the first page, not page 50. What is the correct approach to change the success_url so that I return to the page in the list from where I opened the UpdateView. After much googling, it would appear that this is a common problem, but there is no particular way to handle this. Is there simple solution offered by the generic class based views?
The admin views do have this behaviour, where you return to the correct page in a paginated list after opening the record. I’ve looked at the code behind this however it seems quite complex and involves preserving the filters. It also does not appear to use class based views.