We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination does not carry filter parameters.
Input filter parameters http://127.0.0.1:8000/admin/reports/tpareports/?date_start=2012-09-26&date_end=2028-09-26
Pagination is still original
OS: Windows 10/Alpine Linux v3.13 Python version 3.6 Django version 3.1.3 django-admin-search version 0.3.11 Browser Chrome
This plugin is great. I can't fix it because I'm a Django beginner. I appreciate your contribution whether you fix this or not.
The text was updated successfully, but these errors were encountered:
Hi, just extend the pagination default from admin and drag allong tyhe params:
@register.inclusion_tag("admin/pagination.html", takes_context=True) @register.tag def custom_pagination(context, cl): pagination = admin_list.pagination(cl) url = context.request.get_full_path() url_object = urlparse(url) queries = QueryDict(url_object.query, mutable=True) pagination['extra_params'] = queries.items() extra_param_url = '' for key, value in pagination['extra_params']: if key != 'p': extra_param_url += '&%s=%s' % (key, value) pagination['extra_param_url'] = extra_param_url return pagination
and override the admin pagination:
{% load admin_list %} {% load i18n %} {% load content_extras %} <p class="paginator"> {% if pagination_required %} {% for i in page_range %} <a href="?p={{ i }}{{ extra_param_url }}">{{ i }}</a> {% endfor %} {% endif %} {{ cl.result_count }} {% if cl.result_count == 1 %}{{ cl.opts.verbose_name }}{% else %}{{ cl.opts.verbose_name_plural }}{% endif %} {% if show_all_url %}<a href="{{ show_all_url }}" class="showall">{% trans 'Show all' %}</a>{% endif %} {% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default" value="{% trans 'Save' %}">{% endif %} </p>
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Pagination does not carry filter parameters.
Steps to reproduce
Input filter parameters
http://127.0.0.1:8000/admin/reports/tpareports/?date_start=2012-09-26&date_end=2028-09-26
Pagination is still original
Details
OS: Windows 10/Alpine Linux v3.13
Python version 3.6
Django version 3.1.3
django-admin-search version 0.3.11
Browser Chrome
Add
This plugin is great. I can't fix it because I'm a Django beginner.
I appreciate your contribution whether you fix this or not.
The text was updated successfully, but these errors were encountered: