Re: a question about get_paginate_by method of django.views.generic.list.MultipleObjectMixin

162 views
Skip to first unread message

younger.shen

unread,
Sep 14, 2014, 7:46:32 AM9/14/14
to django-d...@googlegroups.com
my version of django is 1.7

every key to every locked *DREAM* ....................

2014-09-14 18:17 GMT+08:00 younger.shen <younger...@gmail.com>:
hi everyone:

I write a mixin so i check the inner mixins of django itself, and find this

 def get_paginate_by(self, queryset):
        """
        Get the number of items to paginate by, or ``None`` for no pagination.
        """
        return self.paginate_by


i wanna know what the queryset is doing here ?


every key to every locked *DREAM* ....................

younger.shen

unread,
Sep 14, 2014, 7:47:11 AM9/14/14
to django-d...@googlegroups.com

Aymeric Augustin

unread,
Sep 14, 2014, 10:00:49 AM9/14/14
to django-d...@googlegroups.com
Someone might want to return a different value depending on the queryset, especially depending on queryset.count().

-- 
Aymeric.


--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAFp8GAL7GQMGAQqJTL8r2i%2BY_cz4zrU-4pmvODYyZMfxp_F2PQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

younger.shen

unread,
Sep 14, 2014, 8:43:22 PM9/14/14
to django-d...@googlegroups.com
i can use it as  self.queryset, i do not need to pass the queryset as a function parameter, but still thank YOU .

every key to every locked *DREAM* ....................

Reply all
Reply to author
Forward
0 new messages