You are calling save() in parent class. Read more about it here:
https://docs.python.org/3/library/functions.html?highlight=super#super
On 21 March 2018 at 12:52, Utpal Brahma <utpalbrahma1995@gmail.com> wrote:
> /* also explain super ().save() */
>
> from django.db import models
>
> class Blog(models.Model):
> name = models.CharField(max_length=100)
> tagline = models.TextField()
>
> def save(self, *args, **kwargs):
> do_something()
> super(Blog, self).save(*args, **kwargs) # Call the "real" save() method.
> do_something_else()
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3cd4d81a-2660-4b0c-aab1-2ef38cc65335%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFmXjSArZ75JNB0c5sPXVRi9O7DOYUkdjS_2etLHx2%3DM8XrFcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment