5👍
✅
You need to get attribute value dynamically. Use getattr
def method(self, param_name):
field = getattr(self, param_name)
all = field.all()
This should help.
Source:stackexchange.com