37👍
✅
You want __istartswith
:
topics = SpecialtyCategory.objects.filter(name__istartswith=request.GET.get('filter'))
There is a whole complement of i
versions of queryset filters, which are all case insensitive: icontains, iexact, iregex, etc.
Source:stackexchange.com