i want to fetch value dynamically in django model
users = User.objects.all()
for user in users:
print(user.first_name) # works fine
# now how to make it dynamic
onefield = "first_name"
print(user.onefield) # come error
# and for list of field name
fieldnames= ["first_name","last_name","email"]
for i in fieldnames:
print(user.i) # any shortcut for all value