[Solved]-Unsupported lookup 'istartwith' for CharField or join on the field not permitted

22👍

This code is incorrect :

Feed.objects.filter(location__areaHash__istartwith='*****')

Try :

Feed.objects.filter(location__areaHash__istartswith='*****')

2👍

Another Workaround could be using icontains (keeping case-insensitivity as @shacker noticed) :

Feed.objects.filter(location__areaHash__icontains='*****')

Leave a comment