0

I have inlines with a boolean parameter: first. How can I edit the save method, to save only those inlines with first = False?

P̲̳x͓L̳
  • 3,615
  • 3
  • 29
  • 37

1 Answers1

0

Probably the best way to do this is to edit the save function in the model itself:

def save(self, *args, **kwargs):
    if not self.first:
        super(My_Model, self).save(*args,**kwargs)

Of course, replace My_Model with whatever the name of your model is. This will overwrite the default save function so that it will only run if first == False.

MBrizzle
  • 1,783
  • 1
  • 18
  • 31