From 98e1a71ceb75faa706fca237c1c91d3fa12eda0f Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Tue, 21 Dec 2010 14:57:29 +0000 Subject: Fixed #14900 -- Added ability to override the paginator class used in a ModelAdmin. Thanks, Adam Vandenberg. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14997 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/contrib/admin/index.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs') diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 9928118fd9..1e3098d7db 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -516,6 +516,16 @@ subclass:: Django will only honor the first element in the list/tuple; any others will be ignored. +.. attribute:: ModelAdmin.paginator + + .. versionadded:: 1.3 + + The paginator class to be used for pagination. By default, + :class:`django.core.paginator.Paginator` is used. If the custom paginator + class doesn't have the same constructor interface as + :class:`django.core.paginator.Paginator`, you will also need to + provide an implementation for :meth:`MultipleObjectMixin.get_paginator`. + .. attribute:: ModelAdmin.prepopulated_fields Set ``prepopulated_fields`` to a dictionary mapping field names to the @@ -945,6 +955,13 @@ templates used by the :class:`ModelAdmin` views: using the :mod:`django.contrib.messages` backend. See the :ref:`custom ModelAdmin example `. +.. method:: ModelAdmin.get_paginator(queryset, per_page, orphans=0, allow_empty_first_page=True) + + .. versionadded:: 1.3 + + Returns an instance of the paginator to use for this view. By default, + instantiates an instance of :attr:`paginator`. + Other methods ~~~~~~~~~~~~~ -- cgit v1.3