Reputation: 3467
I'm trying to override default save method according to this article, but in both ways I'm getting following error:
super(Blog, self).save(*args, **kwargs)
, I'm getting: name 'Blog' is not defined
models.Model.save(self, *args, **kwargs)
, I'm getting: name 'self' is not defined
Here is whole class - what am I doing wrong?
Upvotes: 0
Views: 55
Reputation: 410612
save
method should happen in the class's save
method (that line is not indented properly, so it's not within the save
method.super
with the current class, so super(Exc, self).save(*args, **kwargs)
.Upvotes: 4