diff --git a/itemlist/views.py b/itemlist/views.py index ed91950..47188c8 100644 --- a/itemlist/views.py +++ b/itemlist/views.py @@ -5,7 +5,7 @@ from django.contrib import admin from django.contrib.admin import FieldListFilter from django.contrib.admin.options import IncorrectLookupParameters -from django.contrib.admin.utils import get_fields_from_path, lookup_needs_distinct, prepare_lookup_value +from django.contrib.admin.utils import get_fields_from_path, prepare_lookup_value from django.core.exceptions import FieldDoesNotExist from django.db import models from django.urls import reverse_lazy @@ -15,6 +15,11 @@ from django.views.generic import ListView from functools import reduce +try: + from django.contrib.admin.utils import lookup_needs_distinct +except ImportError: + from django.contrib.admin.utils import lookup_spawns_duplicates as lookup_needs_distinct + ALL_VAR = 'all' ORDER_VAR = 'order' PAGE_VAR = 'page'