So let\'s say I have a webapp which just lets users save their hobbies. So I have Kind like this:
class Hobby(ndb.Model):
hobby_name = ndb.StringProperty()
<
search.php
needs to be replaced with something like suggetsHobbies.php
That file should return a list of hobbies that the auto-completion tool can use to build the list of hobbies that are suggested. It is given a parameter term
that contains what the user has typed so far. Use that to restrict the list returned. F.ex. if term
is "ba", return a list of hobbies beginning with "ba".
I think you should look into Django packages for this type of behaviour.
This page from djangopackages.com references several packages doing exactly what you want, and written for Django. I suggest you have a look at django-autocomplete-light (the doc is great), or django-selectable, which is more similar to your question's approach.