diff options
| author | Jannis Leidel <jannis@leidel.info> | 2010-12-21 14:57:29 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2010-12-21 14:57:29 +0000 |
| commit | 98e1a71ceb75faa706fca237c1c91d3fa12eda0f (patch) | |
| tree | d025411bdad66d075272e6c261fa2291b3516025 /docs | |
| parent | 7655cd8eac4d745d791feb4349bbbcf69e892948 (diff) | |
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
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 17 |
1 files changed, 17 insertions, 0 deletions
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 <custom-admin-action>`. +.. 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 ~~~~~~~~~~~~~ |
