I’m using jquery autocomplete and following view to display list of objects in inputfiled. It worked.
#views
m = M.objects.filter(title__istartswith=q)
results = [ x.title for x in m ]
json = simplejson.dumps(results)
return HttpResponse(json, mimetype="application/json")
This view searching objects from one model. What should I have to do If I’ve to search from another model too? Like
He (From M Model)
hel (From M Model)
# hell (From P Model)
So also I want to search from P Model. Thank you 🙂
You could just add two lists like that:
Don’t forget to limit results somehow.