﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
14873	A paginated ListView with a List instead of queryset produces an error	andornaut	nobody	"== Background ==

This issue occurs when using a subclass of `ListView` that overrides the `get_queryset` method and returns a `List` instead of a `queryset`, while also defining `paginage_by`. This should work according to the docstring for `get_queryset`, but it produces an exception.

== Relevant Code ==
django.views.generic.list.!MultipleObjectMixin.get_queryset!#15
{{{
#!python
    def get_queryset(self):
        """"""
        Get the list of items for this view. This must be an interable, and may
        be a queryset (in which qs-specific behavior will be enabled).
}}}

django.views.generic.list.!MultipleObjectMixin.paginate_queryset!#31
{{{
#!python
    def paginate_queryset(self, queryset, page_size):
        """"""
        Paginate the queryset, if needed.
        """"""
        if queryset.count() > page_size:
}}}

The error occurs when trying to evaluate `queryset.count()` on a List.

== Possible Solution ==

If a non-queryset Iterable is used, then use `len(queryset)` instead of `queryset.count()`"		closed	Generic views	1.3-alpha		fixed			Unreviewed	0	0	0	0	0	0
