2👍
✅
Use getattr
to get an attribute via a string.
v = 'videos'
getattr(userObj, v).filter(...)
Source:stackexchange.com
2👍
Use getattr
to get an attribute via a string.
v = 'videos'
getattr(userObj, v).filter(...)