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

Django pagination | get current index of paginated item in page index, (not the page index range itself)

I am trying to build a photo gallery with Django. It is set up by category. I have paginated the results of a category by n amount of images per page. I want to also use the paginator on the page that shows just the single image and have a…
cka
  • 93
  • 1
  • 7
1
vote
1 answer

How to create a Paginator for Class Based Views?

I have a requirement for my web application, and that's to create employees ListViews with pagination by last name. The class to list is like follows: class Person(models.Model): first_name = models.CharField(blank=True) last_name =…
1
vote
0 answers

django-pagination issue with extends tag

I'm using django-pagination https://pypi.python.org/pypi/django-pagination 1.0.7 package with Django 1.6. I have observed that my object_list are getting paginated properly when I does work fine ONLY when I do not use extends tag {% extends…
Vijayendra Bapte
  • 1,378
  • 3
  • 14
  • 23
1
vote
1 answer

Change or Remove Default Return Values from PaginationSerializer

I am using the Django REST Frameworks Paginator to paginate the JSON responses read from a database. My current serializers.py file looks like this: class CountrySerializer(serializers.Serializer): country_geoname_id =…
LondonAppDev
  • 8,501
  • 8
  • 60
  • 87
1
vote
1 answer

django-pagination user selected records per page

I've implemented django-pagination in my app to take care of pagination, and it's all good. The one thing I can't figure out is how to allow users to choose a certain value for the records per page e.g. 15, 30, 45, 60, 100 or all records. What's…
Stephen
  • 5,959
  • 10
  • 33
  • 43
1
vote
1 answer

Slicing pagination in ListView?

I have successfully added pagination to a list_contacts view (obviously for a Contact model). And am now trying to setup the template context so that I can limit the pagination display to look like this : < 1 ... 5 6 7 8 9 ... 42 > I went from…
1
vote
1 answer

Join template and pagination of the views

I know, I repeat myself saying I'm new in the world of programming...but i prefer say it even if I think it's obvious from my question... :) this my template: Fims.html: {% extends "Base.html" %} {% block titolo %}Films{% endblock %} {% block…
1
vote
1 answer

How to add pagination to django.contrib.comments?

I am using Django's Comments Framework in my project to handle comments of a movie : My my_comments_app/models.py looks like this : from django.db import models from django.contrib.comments.models import Comment class UserExperience(Comment): …
madil
  • 35
  • 6
1
vote
1 answer

Django Paginator change object_list

Is there a way to change Paginator object_list without creating new Paginator? I would like to order the queryset I passed to the Paginator. Right now I'm creating new Paginator based on the ordered queryset. Thanks
user2161049
  • 853
  • 1
  • 6
  • 13
1
vote
3 answers

Is there a way to convert integer to a list of integers counting upwards?

Just say I have an integer in Python, ex: 100. I'd like to convert this integer into a list counting up to this integer, ex: [1,2,3,... 100] What is the most efficient way to do this? (In case you're wondering why I want to do this, it's because the…
user1328021
  • 9,110
  • 14
  • 47
  • 78
1
vote
1 answer

Handle dropdown box with Django pagination and jquery

In the following code i am trying to add an dropdown box to a tag. To do this i call a function onready and then add it.I have two issues here 1.The table has more than two thousand rows and there i use django pagination.But on ready the drop…
Rajeev
  • 44,985
  • 76
  • 186
  • 285
1
vote
2 answers

Django-pagination for Django 1.4

The docs for django-pagination are out of date for 1.4. When following them, I don't receive errors but the pagination doesn't work. The pagination page counter loads, but there is no pagination. Here is what I have: settings.py…
pythondjango
  • 1,561
  • 2
  • 13
  • 23
1
vote
1 answer

Django paginator and raw SQL

I'm having trouble using djangoś paginator function. In this question i can't find the solution: Django: Paginator + raw SQL query With Table.object.all() i have no trouble, but with raw sql i receive the error object of type 'RawQuerySet' has no…
Mark
  • 645
  • 2
  • 9
  • 27
1
vote
2 answers

override haystack build_page() function

I'm using django-haystack and want to override build_page() function. here is a url of build_page(). I want to replace the default django paginator with django-paginator. thanks alot :-) def build_page(self): """ Paginates the results…
Shah
  • 649
  • 1
  • 5
  • 11
0
votes
2 answers

Django - Pagination in Django 1.3

I'm new to Django. I'm using the simple pagination that Django provides but I need to paginate pages like this: Prev 1 2 3 4 5 6 ... 320 Or Prev 120 121 122 123 Last There are some code ready to reuse in Django 1.3 to achieve this?
André
  • 24,706
  • 43
  • 121
  • 178