feat: add search-as-you-type functionality

This commit is contained in:
2025-01-08 09:18:48 +01:00
parent 4576ac68e0
commit cc97fe32aa
4 changed files with 70 additions and 2 deletions

View File

@@ -39,6 +39,8 @@ class Search:
self.location = None # Can either be Location (DjangoModel) or LocationProxy
self.place_not_found = False # Indicates that a location was given but could not be geocoded
self.search_form = None
# Either place_id or location string must be set for area search
self.location_string = None
if request:
self.search_from_request(request)
@@ -106,6 +108,7 @@ class Search:
self.search_form = AdoptionNoticeSearchForm(request.POST)
self.search_form.is_valid()
self.sex = self.search_form.cleaned_data["sex"]
if self.search_form.cleaned_data["location_string"] != "" and self.search_form.cleaned_data[
"max_distance"] != "":
self.area_search = True