I have an attribute, passed in as a string, which I use to call X.objects.filter(**{string: TION}). This would have the effect of returning all objects of type X, whose attribute string, is “TION”. Is it possible to do this kind of **kwargs input with an __icontains, __contains instead? How would that work?
Share
Just build a string with
__containsout of your attribute.More clearly, you want something like:
or just