Skip to content
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