This discussion is related with ticket 
33233(https://code.djangoproject.com/ticket/33233)

There is pagination in ListView and it show 404 error when page number is 
out of page range.
It is reasonable but I think the options to control 404 exception always 
should be there.
In current Implementation, if users want to handle 404 exception(Http404), 
they have to override 
whole get_queryset() in django.view.generic.list.MultipleObjectMixin or 
validate_number() in django.core.paginator.Paginator. 
And in these process, lots of redundant codes are written.

This is also related with ticket 9798, and they said "Write your own 
wrapper function". But in these processes, lots of redundant codes are 
written because the method, get_queryset(), has what it does. We have to 
serve the original functionality of get_queryset() in overridden method 
while handling Http404 exception.

Also, There already exist allow_empty flag, which makes invalid first-page 
allowed. So I think it doesn't make sense not to serve options to control 
other invalid page. 

So I suggest the flag allow_out_of_range: bool in MultipleObjectMixin class 
to on/off 404 exception.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c8030066-c982-4d64-8de0-7c097d31cca3n%40googlegroups.com.

Reply via email to