diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2010-12-05 04:32:36 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2010-12-05 04:32:36 +0000 |
| commit | ee48da24050a4f447f6ba153430c59b93a1522b3 (patch) | |
| tree | 53ce709ca7825d4fd9c2d7215fd7aea8255efb3b /docs/ref | |
| parent | 23a19240da9894c9784952693d194c8894f077cf (diff) | |
Fixed #14773 -- Modified MultipleObjectMixin to allow for custom paginators. Thanks to piquadrat for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/class-based-views.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/ref/class-based-views.txt b/docs/ref/class-based-views.txt index 28ce024483..1b9a9f99ea 100644 --- a/docs/ref/class-based-views.txt +++ b/docs/ref/class-based-views.txt @@ -305,6 +305,14 @@ MultipleObjectMixin expect either a ``page`` query string parameter (via ``GET``) or a ``page`` variable specified in the URLconf. + .. attribute:: paginator_class + + 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:: context_object_name Designates the name of the variable to use in the context. @@ -329,6 +337,11 @@ MultipleObjectMixin pagination. By default this simply returns the value of :attr:`MultipleObjectMixin.paginate_by`. + .. method:: get_paginator(queryset, queryset, per_page, orphans=0, allow_empty_first_page=True) + + Returns an instance of the paginator to use for this view. By default, + instantiates an instance of :attr:`paginator_class`. + .. method:: get_allow_empty() Return a boolean specifying whether to display the page if no objects |
