Say, I have a model with a text field:
class SomeModel
keyword=models.CharField(null=True, max_length=255)
Now, I know how to check if
Here is a solution that will select SomeModel rows whose keyword is any substring of the querystring, not just complete words:
SomeModel.objects\
.annotate(querystring=Value(querystring, output_field=CharField()))\
.filter(querystring__icontains=F('keyword'))
See docs for info about annotate, Value expressions and F expressions