Allow mutating the queryset
This commit is contained in:
parent
bb5b473898
commit
04d41f7c97
|
@ -50,6 +50,9 @@ class ObjectList(RestrictedViewMixin, ObjectNameMixin, ListView):
|
|||
delete_all_url_name = None
|
||||
widget_options = None
|
||||
|
||||
def queryset_mutate(self, queryset):
|
||||
pass
|
||||
|
||||
# copied from BaseListView
|
||||
def get(self, request, *args, **kwargs):
|
||||
type = kwargs.get("type", None)
|
||||
|
@ -60,6 +63,7 @@ class ObjectList(RestrictedViewMixin, ObjectNameMixin, ListView):
|
|||
|
||||
self.request = request
|
||||
self.object_list = self.get_queryset(**kwargs)
|
||||
self.queryset_mutate(self.queryset)
|
||||
if isinstance(self.object_list, HttpResponse):
|
||||
return self.object_list
|
||||
if isinstance(self.object_list, HttpResponseBadRequest):
|
||||
|
|
Loading…
Reference in New Issue