[Fixed]-Django.db.models.Model could not access property

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

Leave a comment