I'm implementing django-haystack for the first time and need to make a geo-spatial search. Is it possible to access user inputs from urls.py?
I followed the haystack documentation and was able to do basic search using
from django.conf.urls.defaults import *
from haystack.forms import ModelSearchForm, HighlightedSearchForm
from haystack.query import SearchQuerySet
from haystack.views import SearchView
from haystack.views import SearchView, search_view_factory
**sqs = SearchQuerySet().all()**
urlpatterns = patterns('haystack.views',
url(r'^$', search_view_factory(
view_class=SearchView,
template='search/search.html',
searchqueryset=sqs,
form_class=HighlightedSearchForm
), name='haystack_search'),
)
I would need to do sqs = SearchQuerySet().dwithin('location', user_location, D(mi=5))
where user_location will be an user input and going to be passed through GET variable, is there any way I can access that here?
Thank you.