I want to access to a model and its attribute that I defined in my django app via string name. I found these two solutions but they are not fit to my question.
How to access object attribute given string corresponding to name of that attribute
Python: call a function from string name
for example: models.py
Class Foo(models.Model):
var1 = models.CharField(max_length=20)
var2 = models.CharField(max_length=20)
Now, I have "Foo.var2" string and I want to access to Foo model and filter in its var2 field.