Wagtail should be forgiving with filenames at the end of the URL. These
filenames are to make the URL look nice, and to provide a fallback for
browsers that do not handle the 'Content-Disposition' header filename
component. They should not be validated.
It complements the `wagtail.utils.pagination.paginate` function. Views
and templates now do not need to know anything about pagination.
This supersedes pagination in templates that was done with
`{% include "wagtailadmin/pages/listing/_pagination.html" %}`.
A few instances of
`{% include "wagtailadmin/shared/pagination_nav.html }` have also been
converted, but I am not familiar enough with the Wagtail admin template
layout and view structure to convert all uses of this.
Conflicts:
wagtail/wagtailadmin/templates/wagtailadmin/pages/search_results.html
wagtail/wagtailadmin/templates/wagtailadmin/pages/usage_results.html
wagtail/wagtailadmin/templatetags/wagtailadmin_tags.py
wagtail/wagtailadmin/views/chooser.py
Pagination is done almost exactly the same across all of Wagtail. Moving
the repeated code in to one spot ensures mistakes are not made, and
means that pagination is always done consistently.
There are some locations where the pagination helper has not been used,
as there is no request available or something similar. These instances
are special enough that refactoring them does not make sense at this
point.
Conflicts:
wagtail/wagtailadmin/views/chooser.py
wagtail/wagtailadmin/views/pages.py
wagtail/wagtaildocs/views/chooser.py
wagtail/wagtaildocs/views/documents.py
wagtail/wagtailforms/views.py
wagtail/wagtailimages/views/chooser.py
wagtail/wagtailimages/views/images.py
wagtail/wagtailredirects/views.py
wagtail/wagtailsearch/views/editorspicks.py
wagtail/wagtailsnippets/views/chooser.py
wagtail/wagtailsnippets/views/snippets.py
wagtail/wagtailusers/views/groups.py
wagtail/wagtailusers/views/users.py
A `LookupError` is raised by `apps.get_model()` for an unknown model,
but this `LookupError` was also being raised when values with unhandled
types were passed in. This should be a `ValueError` instead. The
docstring has been amended to document the errors raised.