names = [name for name in db.GqlQuery('SELECT * FROM names')]
values = {'names': ','.join(names)}
self.response.out.write(template.render('template.html', values))
Autocomplete Textbox Example in python + Google app engine