Overriding save method issues
I'm trying to override default save method according to this article, but in both ways I'm getting following error:
- while using: super(Blog, self).save(*args, **kwargs), I'm getting: name 'Blog' is not defined
- while using: models.Model.save(self, *args, **kwargs), I'm getting: name 'self' is not defined
Here is whole class - what am I doing wrong?
- The call to the superclass's save method should happen in the class's save method (that line is not indented properly, so it's not within the save method.
- You should call super with the current class, so super(Exc, self).save(*args, **kwargs).