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

Django Endlesss pagination breaks buttons genereated by endlesss pagination

I have endless pagination working on my site for posts. Each post has a like and dislike button which works using ajax. The first set of posts have working buttons but all posts delivered with pagination don't have working buttons. When clicking…
0
votes
0 answers

Adding pagination on searched data in django using ajax call

I am trying to do pagination on the searched data but when clicked on the pagination option like on clicking second page i am not able to recieve the value of q and it throws error.
0
votes
0 answers

TypeError: PaginationMiddleware() takes no arguments when trying to use django-pagination

I'm trying to make django-pagination work with django-filter since I'm working with very large tables. But, after implementing it, when I try to do python manage.py runserver, I get a TypeError: TypeError: PaginationMiddleware() takes no…
0
votes
1 answer

Django pagination does not match input Query

I have a bit of code that looks something like this. page_objects = Page.objects.exclude(lorem).filter(blah).annotate(key=bar).order_by(foo) paginator = Paginator(page_objects, 50) On my UI, I notice that with certain values of bar, I am missing…
wonton
  • 7,568
  • 9
  • 56
  • 93
0
votes
1 answer

Queried Results from Database Disappear on Pagination: Django

I am new to using the Django framework. I am creating a form to take in User input to query a database. I want to display the queried results on the same page, below the from fields. I am able to do the same. However, upon implementing Pagination,…
0
votes
1 answer

How to scroll to specific element using the Infinite Scroll With Django?

When I initially load the page, It loads 10 items(1,2,3...10) and after scrolling down I am getting another 10 items(11,12,13,...20). But I need to directly scroll to the 12th element. I am using the Waypoint infinite scrolling(JQuery) and Django…
0
votes
0 answers

Use django pagination with SQL query and no ORM

I know how to use django pagination with ORM django after filtering the required data and put in into pagination div queryset_list = employee.objects.all() query=request.GET.get("q") if query: queryset_list=queryset_list.filter( …
Dev Dj
  • 169
  • 2
  • 14
0
votes
1 answer

How to paginate bootstrap cards with django

I am getting my query results based on user selection and showing them on bootstrap cards in django. I am using django Paginator to display at max 6 results per page (currently set to 1 for testing). The problem is my Paginator is showing all the…
0
votes
1 answer

Django pagination - with unlimited queries

I am using Django pagination - and it works great ;) ... But in some cases I have a URL with queryies - and when i use the default template setup for pagination - it wont work..
pkdkk
  • 3,905
  • 8
  • 44
  • 69
0
votes
1 answer

Django pagination on model with foreign key

Post and comment models class Post(models.Model): title = models.CharField(max_length=120) content = models.TextField() class Comment(models.Model): post = models.ForeignKey(Post, on_delete=models.CASCADE) content =…
asdfkjasdfjk
  • 3,784
  • 18
  • 64
  • 104
0
votes
0 answers

How to create class based pagination in django on custom array

I am new to python and I am using django class based pagination with below code: class Demo(LoginRequiredMixin, ListView): model = users template_name = 'users_list.html' context_object_name = 'users' filterset_class = users …
Nilesh Kumar
  • 370
  • 2
  • 3
  • 16
0
votes
1 answer

Why does my django pagination keeps returning the same items infinitely?

I am using django and ajax to create a infinite scroll on my website. I would like it to load more items from the database (that are in the next page) when the user scrolls to the bottom of the page. Everything is working perfectly except that it…
Opp
  • 520
  • 1
  • 8
  • 21
0
votes
0 answers

Paginated data not being displayed in the template Django

I'm sending a query result from my database (combining 3 models) to one of my templates, allowing users to filter the output. Displaying all the information I want works just fine, until I try to paginate the results. Then I get empty QuerySet and…
0
votes
1 answer

Pagination of ListView - Django

Views class ThreadListView(ListView): model = Thread template_name = 'forums/thread.html' def get_context_data(self, **kwargs): # Call the base implementation first to get a context context =…
Bryant
  • 421
  • 2
  • 10
0
votes
1 answer

How to add extra context data in LISTVIEW without breaking built-in pagination

Question about pagination issue: Why if I have for example following LISTVIEW: class BoatListView(ListView): model = BoatModel template_name = "boats.html" paginate_by = 5 def get_context_data(self, *, object_list=None, **kwargs): …
Aleksei Khatkevich
  • 1,923
  • 2
  • 10
  • 27