[Answer]-Django connect temporary pre_save signal

1👍

If I understood your question correctly, you can define the default value for the third field in your model

class MyModel(models.Model):
    field1 = models.IntegerField()
    field2 = models.IntegerField()
    field3 = models.IntegerField(default=1) # This one is the problem

So if the value is not specified then Django will take 1 as default

0👍

Django signals are mostly used as a hook point. Say you are writing a third party app which will be used by other people and you want to provide them with some hook points to manipulate your code, then signals would be used.

In your scenario, I would rather override the save() method of Model than use a signal.

class MyModel(models.Model):
    field1 = models.IntegerField()
    ///
    field3 = models.IntegerField()

    def save(self, *args, **kwargs):
        self.field3 = 1
        super(MyModel, self).save(*args, **kwargs)

Leave a comment