1👍
✅
You can use Python gettattr
@classmethod
def get_my_msg(cls,key):
res = cls.objects.latest("updated_at")
return getattr(res, key)
Source:stackexchange.com