I’ve got one problem, I’ve got model:
class Student (User):
student_number = models.IntegerField()
then I do:
user = Student()
#some code here
user.last_name = 'last_name'
user.student_number = 22
and after calling save method:
user.save()
only field last_name is changed, but after calling:
user.student.save()
only field student_number is changed… Both methods doesn’t work…
So, how to update it in correct way?
That’s not possible. If you are just inheriting the model then, you have all the attributes inside it and calling the save method directly would have saved it provided you have not overrode the save method in a wrong way. I mean to say,
Should have had worked fine. May be you are doing some mistake somewhere please check it out. Otherwise, post the code which you have commented right now.