Skip to content

Commit

Permalink
Merge pull request dbca-wa#537 from ehallein/master
Browse files Browse the repository at this point in the history
removed name from wamtram search for speed
  • Loading branch information
ehallein authored Jan 18, 2024
2 parents 6640e0b + 494101f commit 7182b61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wamtram2/templates/wamtram2/trtturtles_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="row">
<div class="col-xs-12 col-sm-6">
<form action="" method="get">
<input id="search_field" type="text" class="form-control" name="q" placeholder="Search turtles (ID, tags, name, etc.)" value="{{ query_string }}">
<input id="search_field" type="text" class="form-control" name="q" placeholder="Search turtles (ID, tags.)" value="{{ query_string }}">
</form>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion wamtram2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def get_queryset(self):
# General-purpose search uses the `q` parameter.
if "q" in self.request.GET and self.request.GET["q"]:
q = self.request.GET["q"]
qs = qs.filter(Q(pk__icontains=q) | Q(turtle_name__icontains=q) | Q(trttags__tag_id__icontains=q) | Q(trtpittags__pittag_id__icontains=q)).distinct()
qs = qs.filter(Q(pk__icontains=q) | Q(trttags__tag_id__icontains=q) | Q(trtpittags__pittag_id__icontains=q)).distinct()

return qs.order_by("pk")

Expand Down

0 comments on commit 7182b61

Please sign in to comment.