Remove get_queryset fallback
This commit is contained in:
@@ -26,8 +26,8 @@ class ComponentInline(SortableStackedInline):
|
||||
# )
|
||||
model = Component
|
||||
|
||||
def queryset(self, request):
|
||||
qs = super(ComponentInline, self).queryset(
|
||||
def get_queryset(self, request):
|
||||
qs = super(ComponentInline, self).get_queryset(
|
||||
request).exclude(title__icontains='2')
|
||||
if get_is_sortable(qs):
|
||||
self.model.is_sortable = True
|
||||
@@ -37,14 +37,14 @@ class ComponentInline(SortableStackedInline):
|
||||
|
||||
|
||||
class WidgetAdmin(SortableAdmin):
|
||||
def queryset(self, request):
|
||||
def get_queryset(self, request):
|
||||
"""
|
||||
A simple example demonstrating that adminsortable works even in
|
||||
situations where you need to filter the queryset in admin. Here,
|
||||
we are just filtering out `widget` instances with an pk higher
|
||||
than 3
|
||||
"""
|
||||
qs = super(WidgetAdmin, self).queryset(request)
|
||||
qs = super(WidgetAdmin, self).get_queryset(request)
|
||||
return qs.filter(id__lte=3)
|
||||
|
||||
inlines = [ComponentInline]
|
||||
|
||||
Reference in New Issue
Block a user