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
1
vote
1 answer

Failed lookup for key [start_index]

i got some problem with the pagination this is my code template {% for post in post %} {{forloop.counter|add:post.start_index }} {%endfor%} view.py def rankpag(request): with connection.cursor() as…
Mr.Lio
  • 21
  • 4
1
vote
1 answer

Pagination not working for viewsets in django rest_framework

paginate.py class StandardResultsSetPagination(PageNumberPagination): page_size = 3 page_size_query_param = 'page_size' max_page_size = 5 Serializers.py class AreaUsersSerializer(serializers.ModelSerializer): class Meta: …
1
vote
1 answer

Django load more comments with AJAX

In the profile page, I want to display posts of a user. Each post might have several comments, I don't want to display all the comments to the post instead I want to display only few comments and add load more comments option. If a user clicks load…
sreekanthkura7
  • 115
  • 2
  • 18
1
vote
1 answer

Django Filter, seacrh query and pagination

I have a problem using filters and pagination, I have tried so many examples I've seen here on stack overflow but nothing seems to be working. I am using CBV(ListView). The filter works but the pagination has an issue, when i click next or page 2…
Bruce
  • 103
  • 1
  • 8
1
vote
1 answer

Django Pagination - re group and show group of times per page?

Im currently regrouping some data and then displaying that data in columns whilst also using pagination. However, due to the ordering of the origin data, there are instances where column 1 has 1 entry in but actually has 5 or 6 total entries, but…
AlexW
  • 2,843
  • 12
  • 74
  • 156
1
vote
1 answer

how to use django pagination?

i have a django project and it includes pagination i do not know where is the error in my code but once i tired to go to the next or previous page it crash and display the below error : can only concatenate str(not ""NoneType) to str …
Dev Dj
  • 169
  • 2
  • 14
1
vote
0 answers

Appending lazy-loaded elements to ul causes scrollTop to jump to zero

I'm using waypoint.js library to detect when the user has scrolled to the bottom of the ul. this then triggers an axios call to my server, returning an html string. I am creating elements from this string using a template tag, removing some…
1
vote
0 answers

How can I include a Count in my Django Rest Framework Pagination to count the total number of rows?

I have written a code in Python using Django Rest Framework to fetch data from database(MySql) and view it in browser using Pagination(PageNumberPagination).It is working fine but the problem is the "count" is not coming in view. I want to show the…
Rounak Modak
  • 155
  • 1
  • 2
  • 14
1
vote
1 answer

How to implement pagination in a Django and React app without using the REST framework?

I am working on a website whose back-end is in Django and front-end is developed using React. I want to add the pagination feature in the website but don't know how it will be implemented in the frontend part. I want to send the total page count to…
Ahmad Javed
  • 544
  • 6
  • 26
1
vote
1 answer

How to add parameters in a url in render method - Django?

How to add parameters in a url in render method - Django? I'm having difficulty adding pagination to a search result. On the first page the result is shown perfectly, but from the second page onwards, the search parameter no longer exists. thank…
marcelo.delta
  • 2,730
  • 5
  • 36
  • 71
1
vote
1 answer

How to show page items count in django pagination for CBV?

I'm trying to figure out how to show something like "Showing 1-10 of 52" using django pagination in my templates. I am using CBV for my application. This is what I have done In my views.py: class viewbloglistview(LoginRequiredMixin,ListView): …
Niladry Kar
  • 1,163
  • 4
  • 20
  • 50
1
vote
0 answers

django_tables2 pagination and sorting don't work

I'm using django_talbes2 and the table renders correctly (in a sense that it displays all the information it should), but when I click on a column header to sort it or on a page number to go to the next page it "breaks" -- it returns to the home…
Oleksandr K
  • 119
  • 1
  • 10
1
vote
1 answer

Apply pagination to Raw query to prevent ALL records being loaded

I have the following class based view that works as expected and paginates the results as required with parameters http://127.0.0.1:8000/api/collection/fromdetroit?page=1 >> ?page=2 etc class ListReleasesCollectionView(APIView): def get(self,…
Franco
  • 2,846
  • 7
  • 35
  • 54
1
vote
1 answer

Pagination Django Class Based View Not Working Properly

I'm trying to use Django (v2.0) pagination with CBV and got issues. The pagination is active because the tag {% if is_paginated %} returns "True" and shows the "PagNav" and the browser path changes too, like this (..?page=1, ...?page=2, etc...) but…
1
vote
0 answers

Django: prefetch and paginate relative objects

I have a simple two-level comments system with model class Comment(models.Model): text = models.TextField() parent = models.ForeignKey('self', related_name='children') In view I need to paginate first and second level comments. Now I do it…
MaxCore
  • 2,438
  • 4
  • 25
  • 43