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
3 answers

How to get the number of items in Page object?

I've learned a little about django pagination from here : https://docs.djangoproject.com/en/2.0/topics/pagination/#page-objects And I want to know how to get the number of items in certain Page object. I thought a way like this : Page.end_index() -…
touchingtwist
  • 1,930
  • 4
  • 23
  • 38
1
vote
1 answer

how to do a pagination-django with variable 'per_page'?

how to do a pagination with variable 'per_page'. For example, I have 100 articles I wish that the first page (1) contains 3 articles, the second page (2) contains 5 articles, will excite, me who draws of how many articles in each page. see the…
1
vote
1 answer

Django last page pagination redirect

My problem is similar to this problem. The only difference is I use GCBV for my pagination. My view file is as follows: class ChatListView(ListView): model = Chat form_class = NewMessageForm template_name = 'chat.html' paginate_by =…
user8703143
  • 173
  • 1
  • 14
1
vote
1 answer

How to paginate queryset for Serializer

I'm retreiving Category and its outfits list. My problem is there are too many outfits belong to a category. class CategoryListAPIView(generics.RetrieveAPIView): serializer_class = CategoryDetailSerializer ... class…
1
vote
1 answer

django-pagination not working

My category.html page is like this right now and the pagination is not working. It doesn't even show any error. {% autopaginate category.entries.all 5 %} #line 17 {% for entry in category.entries.all %}
  • Sushi
    • 631
    • 1
    • 8
    • 19
  • 1
    vote
    1 answer

    Django Pagination with other variables in the GET request in a Function Based View

    I've tried to implement the following solution from here: How to paginate Django with other get variables? I added this to my views.py from urllib.parse import urlencode from django import template register =…
    Roma
    • 449
    • 6
    • 23
    1
    vote
    2 answers

    Pagination for very long string Django 1.11 (Python 3.6)

    I'm trying to create my own blog site which might contain a very long story (from one field in database). I successfully create pagination for list of records (for the list of stories) on my other views and tried to experiment from the Django…
    1
    vote
    1 answer

    How to paginate django queryset by field effectively?

    I have a model with a Boolean field, and I want to paginate the query set of this model by the Boolean field with the rule: Page size is 10 Each page contain 2 items whose Boolean field is True and 8 items whose Boolean field is False If one page…
    Fogmoon
    • 569
    • 5
    • 16
    1
    vote
    0 answers

    Django pagination - 5k objects

    As a continuation of this question Django pagination with bootstrap any my works under my Contacts app I have to ask for your help once more. I have a problem I cannot resolve. I used few suggestions about pagination but all that is changing is the…
    Jan Mejor
    • 141
    • 3
    • 15
    1
    vote
    1 answer

    Reversing results for current page (django paginator generic view)

    I'm using the standard django paginator in my generic view like this: def get_context_data(self, **kwargs): context = super(ArchivePagedView, self).get_context_data(**kwargs) article_list = Article.published …
    Asqiir
    • 607
    • 1
    • 8
    • 23
    1
    vote
    1 answer

    EmptyPage Error in Django pagination

    I am tring to make digg-style pagination in my django application. I used custom templatetags. First and last pages didnt work and I dont understand how to fix that. However other pages work fine. Where I did mistake? First page Error: EmptyPage:…
    Nurzhan Nogerbek
    • 4,806
    • 16
    • 87
    • 193
    1
    vote
    1 answer

    How to split template for the given link for pagination :

    Given this link for twitter-style pagination in Django. I'm trying to implement the same in my app but can't understand the splitting of template. I'm giving here the code of my HTML page for which I want to apply the pagination . Can anyone please…
    1
    vote
    0 answers

    Django (1.9) paginate different items on first page

    I have a different design on the first page of a list, and need 8 items on the first page. On the rest I would like 9 items. I have tried to specify items on the first page, but the second page thinks the 9.th item was shown on the first page, it…
    Tomas Jacobsen
    • 2,368
    • 6
    • 37
    • 81
    1
    vote
    2 answers

    DjangoRestFramework - How to serialize only certain number of objects when ViewSet GET / LIST is called?

    So this is my ViewSet: class PostViewSet(viewsets.ModelViewSet): queryset = Post.objects.all() serializer_class = PostSerializer permission_classes = (IsAuthenticated, IsLikeOrOwnerDeleteOrReadOnly,) def perform_create(self,…
    SilentDev
    • 20,997
    • 28
    • 111
    • 214
    1
    vote
    1 answer

    Django date sorting issue with null values

    Ok so i am using Django with eztables for ajax and pagination with jquery datatables. I think there must be some issue with the way django-eztables sorts dates with null values. If there are dates everything works fine, but when it starts to get to…
    mingle
    • 580
    • 2
    • 6
    • 24