* cc: boxm@… (added)
* easy: => 0
Comment:
I've been looking at this today and there's quite a few places where the
assumption that the paginator is dealing with a countable set is made.
Making it work where you don't want to/can't count the number of items in
the set means changing:
1. the {% search %} admin tag
2. the {% pagination %} admin tag
3. the ChangeList class (in changelist_view method)
4. the paginator to one that doesn't implement count, num_pages and
page_range properties
1 & 2 can be fixed by overriding the change_list.html template to use
alternative template tags (e.g. {% infinite_pagination %}). 3 requires
deriving from ModelAdmin and cut'n'pasting the entire method. 4 is
available here: http://code.google.com/p/django-
pagination/source/browse/trunk/pagination/paginator.py
However this is really ugly and a lot of work for someone.
I think ideally the template tags and ChangeList class should be updated
to not assume the ability to access the count, num_pages and page_range
properties - ie have an "UncountedPaginator". Possibly this would be a
base class of Paginator so you'd have NullPaginator (displays everything)
-> UncountedPaginator -> Paginator.
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by adamnelson):
I strongly agree with boxm on this one. Counting the number of records is
often most onerous for the very sets that need to be paginated. The
!UncountedPaginator is a great solution.
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:12>
Comment (by boxm):
Patch that implements above idea on #8408 - this should enable a
NullPaginator to work with admin
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:13>
* cc: mmitar@… (added)
* ui_ux: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:14>
* stage: Someday/Maybe => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:15>
* owner: adamv => aaugustin
* status: reopened => new
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:16>
* owner: aaugustin => nobody
Comment:
Please don't assigned tickets to people without their consent. I'm not
going to work on this.
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:17>
* cc: cmawebsite@… (added)
Comment:
I believe this issue is fixed in 1.8 by the `show_full_result_count`
option (ticket #8408 mentioned above).
Can everything else be handled by setting `list_per_page` to a very large
number?
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:18>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:19>
* cc: dhui (added)
* status: closed => new
* resolution: fixed =>
Comment:
`show_full_result_count` does not fix the issue as `paginator.count` is
still called:
https://github.com/django/django/blob/1.8.3/django/contrib/admin/views/main.py#L177
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:20>
Comment (by sasha0):
It does fix the issue, since `paginator.count` return '''total''' number
of objects -
https://github.com/django/django/blob/1.8.3/django/core/paginator.py#L66
Thus, I believe the ticket could be closed.
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:21>
* status: new => closed
* resolution: => fixed
--
Ticket URL: <https://code.djangoproject.com/ticket/4065#comment:22>