5👍
✅
You can make a dictionary and unpack it into the keyword arguments:
filters = {'entry__headline__contains': 'Lennon'}
Blog.objects.filter(**filters)
where entry__headline__contains
can be dynamically evaluated.
Source:stackexchange.com