So I suggest the flag `allow_out_of_range: bool` in `MultipleObjectMixin`
class to on/off 404 exception.
(I already have a pull request ready to go.)
--
Ticket URL: <https://code.djangoproject.com/ticket/33233>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* cc: DongGeon Lee (added)
* owner: nobody => DongGeon Lee
--
Ticket URL: <https://code.djangoproject.com/ticket/33233#comment:1>
--
Ticket URL: <https://code.djangoproject.com/ticket/33233#comment:2>
Old description:
> 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.py` or `validate_number()` in
> `django.core.paginator.py`.
>
> So I suggest the flag `allow_out_of_range: bool` in `MultipleObjectMixin`
> class to on/off 404 exception.
> (I already have a pull request ready to go.)
New description:
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`.
So I suggest the flag `allow_out_of_range: bool` in `MultipleObjectMixin`
class to on/off 404 exception.
(I already have a pull request ready to go.)
--
--
Ticket URL: <https://code.djangoproject.com/ticket/33233#comment:3>
* status: assigned => closed
* has_patch: 1 => 0
* resolution: => duplicate
Comment:
Duplicate of #9798.
--
Ticket URL: <https://code.djangoproject.com/ticket/33233#comment:4>