I have inlines with a boolean parameter: first
.
How can I edit the save
method, to save only those inlines with first = False
?
Asked
Active
Viewed 76 times
1 Answers
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