mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 22:23:23 +00:00
pedagogy: rename query to search in search API
This commit is contained in:
parent
502ae09523
commit
22c028af11
@ -162,7 +162,7 @@ class UVListView(CanViewMixin, CanCreateUVFunctionMixin, ListView):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
query = self.request.GET.get("query", None)
|
search = self.request.GET.get("search", None)
|
||||||
|
|
||||||
additional_filters = {}
|
additional_filters = {}
|
||||||
|
|
||||||
@ -178,14 +178,14 @@ class UVListView(CanViewMixin, CanCreateUVFunctionMixin, ListView):
|
|||||||
else:
|
else:
|
||||||
additional_filters["semester"] = semester
|
additional_filters["semester"] = semester
|
||||||
|
|
||||||
if not query:
|
if not search:
|
||||||
return super(UVListView, self).get_queryset().filter(**additional_filters)
|
return super(UVListView, self).get_queryset().filter(**additional_filters)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
queryset = (
|
queryset = (
|
||||||
SearchQuerySet()
|
SearchQuerySet()
|
||||||
.models(self.model)
|
.models(self.model)
|
||||||
.autocomplete(auto=html.escape(query))
|
.autocomplete(auto=html.escape(search))
|
||||||
)
|
)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return self.model.objects.none()
|
return self.model.objects.none()
|
||||||
|
Loading…
Reference in New Issue
Block a user