I cant find any examples of client side auto complete with drop down search results and django haystack. I have looked into django-selectable but it dosen’t use text fields. how to integrate jquery auto complete with django haystack
@login_required
def autocomplete(request):
if 'term' in request.GET:
people = Person.objects.filter(
first_name__contains=request.GET['term']
)[:10]
print people.count()
return HttpResponse( simplejson.dumps( [ people.first_name for person in people ] ) )
I am for some reason getting a javascript error in google inspect element on debug mode:
'QuerySet' object has no attribute 'first_name'
It was supposed to be person.first_name and not people