1
Your class holds many items within it. You need to tell the model which instance you are wanting by calling it by “pk” or other unique field.
user = Employee.objects.get(pk=id)
user.user_name
Source:stackexchange.com
1
Your class holds many items within it. You need to tell the model which instance you are wanting by calling it by “pk” or other unique field.
user = Employee.objects.get(pk=id)
user.user_name