Questions tagged [django-pagination]

Django-pagination refers to the Django (a Python-based and open-source web framework) way of managing data split across several pages, with "Previous/Next" links. Use this tag for questions related to classes related to pagination in Django.

Django-pagination refers to the Django (a Python-based and open-source web framework) way of managing data split across several pages, with "Previous/Next" links. Use this tag for questions related to classes related to pagination in Django.

300 questions
2
votes
2 answers

How do I make a reusable Django page navigation solution for templates

(this is me sharing a solution i came up with for this fundamental issue i ran into when attempting to create page navigation) This seems like such a basic thing that I can't believe it was so hard to find a basic solution to this. Basically…
w--
  • 6,427
  • 12
  • 54
  • 92
2
votes
1 answer

Using generic ListView with pagination. Django

Now I have the following code in the views.py: class IndexView(generic.ListView): model = Question template_name = "qa_forum/index.html" context_object_name = 'question_list' paginate_by = 25 Its work good, but it retrieves all…
9Algorithm
  • 1,258
  • 2
  • 16
  • 22
2
votes
3 answers

Different template for django-pagination

I have just started playing around with django-pagination, which is included in some other 3rd-party app I am using for one of my projects. Does anyone know if it's possible to replace the pagination.html template inside django-pagination with a…
mzu
  • 759
  • 8
  • 20
2
votes
2 answers

jquery to add scroll down pagination to show results

Currently I am using django-pagination to show limited results at one page ... {% autopaginate object_list 10 %} {% for item in object_list %} ... {{ item }} ... {% endfor %} ... {% paginate %} ... I need jquery to do this. load results at scroll…
Ch Zeeshan
  • 1,644
  • 11
  • 29
1
vote
3 answers

Unable to paginate object_list usng django-pagination

I am using django-pagination to paginate the a list of objects in my temlate. I have installed the app, added it in my project and added pagination.middleware.PaginationMiddleware in my settings.py file. But when I try to use it in my template the…
Sachin
  • 3,672
  • 9
  • 55
  • 96
1
vote
1 answer

Django pagination giving error: Caught TypeError while rendering: 'Page' object is not iterable

I am using django pagination, as told in documentation: view part is : def list(request): job_list = Job.objects.all() paginator = Paginator(job_list, 25) # Show 25 jobs per page page = request.GET.get('page',1) try: jobs =…
Hafiz
  • 4,187
  • 12
  • 58
  • 111
1
vote
3 answers

I have problems with setting up django-pagination

I'm making a template for Django site (it's quote database). I wanna have Digg-like pagination. Altough, author of the application has made his own pagination, unfortunately without page numering (just "previous" and "next" links). So I've installed…
Stonem
  • 11
  • 1
  • 3
1
vote
0 answers

Faster Django Pagination App

We use django-paging, which is a bit old. One of the big issues is that the app performs a count on the queryset returned by each view, which is slow and doesn't provide us any value in our case. I see that django-pagination has more…
Ben
  • 15,010
  • 11
  • 58
  • 90
1
vote
0 answers

How to paginate multiple queries in a single function-based-view or class-based-view in django?

I have a search function that queries multiple models. I have the expected results displayed in a html template and so far all is fine. The problem is that I want to paginate the results using django's built in Pagination class. Pagination with…
1
vote
1 answer

Django 3.2.3 Pagination isn't working properly

I have a Class Based View who isn't working properly (duplicating objects and deleting some) Tested it in shell from django.core.paginator import Paginator from report.models import Grade, Exam f = Exam.objects.all().filter(id=7)[0].full_mark all =…
Ahmed Abo 6
  • 1,151
  • 2
  • 9
  • 11
1
vote
1 answer

Want to return current page limit in response in Django Rest Framework

Want to return current page limit current_items_per_page in response. pagination.py class CustomPageNumberPagination(pagination.PageNumberPagination): page_size = 10 # Number of objects to return in one page page_size_query_param =…
1
vote
1 answer

Django pagination has_previous and has_next methods doesn't work

I'm using pagination in Django 1.11. But when I use has_next and has_previous it returns false everytime. Don't print anything. I'm sure that there is previous and next pages. In views I'm using TableView which is like ListView. Here is my…
1
vote
1 answer

Django - Paginate a table

I wrote a template that displays a table, something in the form: ...
I would like the paginate the table: 10 rows per page. I've tried using {% autopaginate object_list 10 %}, but I don't have a specific list to give as parameter…
1
vote
2 answers

Django, django-filter and pagination

my goal is to have a 'user_profile' page that displays relevant information of the user of interest. Furthermore, the 'user_profile' page should include all the posts that were created by the respective user as new blog entries. These posts,…
daniel
  • 11
  • 1
  • 3
1
vote
1 answer

Django rest how to do pagination with PageNumberPagination

I wrote the following codes. But when I go to the url posts?page=1, it still shows all of the Post model objects. What should I do? settings.py REST_FRAMEWORK = { 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', …
ParsaAi
  • 293
  • 1
  • 14