I need to query like:
MyModel.objects.filter(title_de="some title")
where de
inside title_de
is dynamic
I cannot do:
MyModel.objects.filter('title_%s' % language = "some title")
how can I do this?
Use kwargs,
kwargs = {
f"title_{language}": "some title"
}
MyModel.objects.filter(**kwargs)