#33233: Handle 404 Not Found Error when page number is out of page range
-------------------------------------+-------------------------------------
Reporter: DongGeon Lee | Owner: DongGeon
| Lee
Type: New feature | Status: assigned
Component: Generic views | Version: 4.0
Severity: Normal | Resolution:
Keywords: ListView, | Triage Stage:
Paginator, Pagination | Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by DongGeon Lee:
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>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/073.dc62a36e2441163f397f78c0de3037ff%40djangoproject.com.