I’m trying to filter an object based off its first letter with:
topics = SpecialtyCategory.objects.filter(name__startswith=request.GET.get('filter'))
The problem is that the name could be “Example” or “example” and I want to get all SpecialtyCategory regardless of the case.
How do I do this?
You want
__istartswith:There is a whole complement of
iversions of queryset filters, which are all case insensitive: icontains, iexact, iregex, etc.