[Fixed]-Ignoring case with __startswith

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.

👤jcdyer

Leave a comment