Skip to content

BI: Update for changes made to admin.FieldListFilter in Django 5.x #37

New issue

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions admin_numeric_filter/admin.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import django
from django.contrib import admin
from django.contrib.admin.utils import reverse_field_path
from django.db.models import Max, Min
Expand Down Expand Up @@ -73,10 +74,12 @@ def __init__(self, field, request, params, model, model_admin, field_path):

if self.parameter_name + '_from' in params:
value = params.pop(self.field_path + '_from')
value = value if django.VERSION < (5, 0) else value[-1]
self.used_parameters[self.field_path + '_from'] = value

if self.parameter_name + '_to' in params:
value = params.pop(self.field_path + '_to')
value = value if django.VERSION < (5, 0) else value[-1]
self.used_parameters[self.field_path + '_to'] = value

def queryset(self, request, queryset):
Expand Down