Działanie Django podczas tworzenia modelu

# override create model method (django)

class MyModel(models.Model):
  name = ....
  ........
  .......
  def save(self, *args, **kwargs):
      if not self.pk:
          # This code only happens if the objects is
          # not in the database yet. Otherwise it would
          # have pk
          
          # -- do your custom actions here --
          
      super(MyModel, self).save(*args, **kwargs) # activate the default method on update
Repulsive Raven