[Answer]-Case insensitive autocomplete with Django

1👍

To get just the unique tag text matches, I think this should work:

tag_text = BGTag._model_class.objects.filter(tag__istartswith=term, author_token=self.my_token).extra(select={'lc_tag': 'LOWER(tag)'}).values_list('lc_tag', flat=True).distinct()

Leave a comment