def get_queryset(self):
qs = super().get_queryset()
form = self.form(self.request.GET)
if form.is_valid():
if form.cleaned_data['ordering']:
qs= qs.order_by(form.cleaned_data['ordering'])
return qs