Skip to main content
deleted 120 characters in body
Source Link
Mohit Harshan
  • 2k
  • 1
  • 23
  • 48

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel 'self.class' is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

So just call ,

super(ChildModel, self).save(*args, **kwargs) 

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel 'self.class' is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel 'self.class' is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

So just call ,

super(ChildModel, self).save(*args, **kwargs) 
deleted 120 characters in body
Source Link
Mohit Harshan
  • 2k
  • 1
  • 23
  • 48

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel 'self.class' is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

So just add this line to the end of your operations in Child model:

super(Child, self).save(*args, **kwargs) 

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel 'self.class' is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

So just add this line to the end of your operations in Child model:

super(Child, self).save(*args, **kwargs) 

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel 'self.class' is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel self class'self.class' is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

So just add this line to the end of your operations in Child model:

super(Child, self).save(*args, **kwargs) 

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel self class is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

If you inherit ChildModel from BaseModel, when you get to the save method in BaseModel 'self.class' is still ChildModel. So it finds the super of Child, which is BaseModel, so calls the save in BaseModel.

So just add this line to the end of your operations in Child model:

super(Child, self).save(*args, **kwargs) 
deleted 848 characters in body
Source Link
Mohit Harshan
  • 2k
  • 1
  • 23
  • 48
Loading
Source Link
Mohit Harshan
  • 2k
  • 1
  • 23
  • 48
Loading