﻿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
29680	Paginate start with last Page	Dario Navin	Dario Navin	"Hi,

currently you can't set the paginate to start with the last page if no page is given unless you put in the url.

MultipleObjectMixin:
{{{
        page_kwarg = self.page_kwarg
        # I suggest removing the static 1 and replace it with a function called 
        # get_start_page whose default return value is 1
        page = self.kwargs.get(page_kwarg) or self.request.GET.get(page_kwarg) or 1
        try:
            page_number = int(page)
        except ValueError:
            if page == 'last':
                page_number = paginator.num_pages
            else:
                raise Http404(_(""Page is not 'last', nor can it be converted to an int.""))
}}}

Suggested change:

{{{
page = self.kwargs.get(page_kwarg) or self.request.GET.get(page_kwarg) or self.get_start_page()
}}}

Default would be 1. Then for starting with the last page someone could set it to

{{{
def get_start_page(self):
       return self.get_paginator().num_pages
}}}


I did search but could not find any report about it. 

If someone could approve this, I would submit a fix.

Best regards,

Dario Heinisch
"	Cleanup/optimization	closed	Generic views	2.1	Normal	wontfix			Unreviewed	0	0	0	0	0	0
