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
0
votes
0 answers

Django search-fields and pagination got error

I have a view: class ProductView(CreateModelMixin, ListModelMixin, GenericViewSet): serializer_class = ProductSerializer pagination_class = ProductDefaultPagination filter_backends = (DjangoFilterBackend, filters.SearchFilter) …
0
votes
0 answers

Is there a way to paginate Django's admin page that uses the django-nested-admin lib?

I have an admin page using NedstedStackedInLine, and the problem is that in the inside model, i have to many occurrences of the secondary model. Is there a way to paginate the inside models to not cause 502 error when the users tryng to access the…
0
votes
1 answer

How to make your own pagination Django

I have some json data from 3rd party API which has parameters like 3rd_party.com/API?NumberOfItemsOnPage=5&PageNumber1 NumberOfItemsOnPage - how many items will be on one page and PageNumber - current page. This json has items, info about current…
Zesshi
  • 435
  • 12
0
votes
1 answer

Pagination not using correct values when using order with two fields by in Django Rest Framework

I have a very simple ListAPIView: class MyListView(ListAPIView): pagination_class = QueryParamPagination serializer_class = MyListSerializer queryset = MyObject.objects.all() with a simple class to define the pagination: class…
tommueller
  • 2,358
  • 2
  • 32
  • 44
0
votes
1 answer

How to display the previously filled form values?

I have the following view: class PaginatedFormsView(View): def get(self, request): forms = [PatientsForm(), VisitsForm()] # Get the current page number from the query string page_number =…
udarH3
  • 199
  • 2
  • 5
  • 16
0
votes
1 answer

Using Pagination with JsonResponse

I'm currently working on CS50W Network project which is basically a social media clone. I want to get different objects via a fetch API request, which is working fine. But after I implemented Pagination I get a 404 not found. When The DOM of the…
0
votes
0 answers

Paginator not functioning Django

I made a searchbar for my website, my database is getting quite big now so I wanted to add pagination system, but if I click the buttons I made it shows me the text that I want to show when nothing is typed in. code: def search_album(request): …
NART
  • 1
  • 1
0
votes
0 answers

I want to improve my queryset performance, I am using Pagination to return paginated response in django but its taking so much time

here is my pagination code over a queryset. query_end_time = time.time() - start print(query_end_time, "query_end_time") total_rows = query_set.count() number_of_pages = 0 paginator = Paginator(query_set,…
0
votes
0 answers

Gow ot save info about search in django?

I want to do pagination. And when I press to button 'Next' on my page, my website breaks down. It happens because for the next page variable 'searched' is empty. 'Searched' is name of tag input in my form I don't know how to save variable 'searched'…
0
votes
0 answers

How to do pagination in Django? I have TypeError

I want to do pagination on my site. I do API-call to supplier's website. I get data, deserialize and save it in my model, then get those objects for view them. Also I get all unique names for query into model and I have error in that function. When…
0
votes
0 answers

How to add custom pagination with parameters in DRF?

I have different ViewSets for CRUD operations with entities in my project. I want to return paginated response and I created custom pagination where I overrided get_paginated_response method. For now it looks like this: class…
0
votes
1 answer

Pagination does not seem to be working in Django rest api with GET method

I have been trying to paginate by json response but in vain. below are my code snippets. views.py This gives me the entire result. The reason i'm converting to a dataframe is that i want to do some data cleaning and minipulation. class…
0
votes
1 answer

Django - Save form fields while paging

This will be a lengthy post, please have patience with me, I just started with Django and try to wrap my head around it. I created a site that will go thru exam questions one at a time, displaying the question and the multiple choice answers like on…
Steve
  • 1,028
  • 7
  • 25
  • 42
0
votes
1 answer

Django Pagination not work in the next page

I'm building an application that allows to page the result of a search. The results can be numerous that's why I used django's pagination. I have configured filters and sorting of results displayed by 10: ` def search_details(request, type_anc): …
0
votes
1 answer

While paginating my results of dictionary values in djnago I am getting an error as unhashable type: 'slice'

I am trying to paginate my results(dictionary values) to html page. While doing I am getting an error unhashable type: 'slice' views.py from django.shortcuts import render import urllib.request import json from django.core.paginator import…