django-next-prev | Django utility to retrieve the next or previous object
kandi X-RAY | django-next-prev Summary
kandi X-RAY | django-next-prev Summary
Django utility to retrieve the next or previous object, given a current object and a queryset.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Return the next or previous queryset
- Get attribute from an instance
django-next-prev Key Features
django-next-prev Examples and Code Snippets
Community Discussions
Trending Discussions on django-next-prev
QUESTION
I'm new to Django, and I'm working on my first real (i.e., non-tutorial) project. I have class-based ListViews on four models, and the lists can be filtered in various ways. The user can click on anything in a filtered list to get a DetailView of the item. This is all straightforward and works fine.
I would like to have Previous and Next buttons on the detail pages that allow the user to step through the current filtered set in the default order (which is not date or id). I've found various bits and pieces on StackOverflow and elsewhere that look like parts of a solution, but I haven't been able to figure out how to make them all work together in my views.
Here is slightly simplified code for one of my tables. "Works" are various items (plays, operas, ballets, etc.) that were performed in one of two theaters.
...ANSWER
Answered 2021-Apr-26 at 04:35Previous page:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-next-prev
You can do the following.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page