2👍
✅
You would need to overwrite the Model’s save method like that:
class YourModel(model):
....
def save(self,*args,**kwargs):
if not self.id:
update_name=True
else:
update_name=False
super(YourModel,self).save(*args,**kwargs)
if update_name:
self.name='whatever %s' %self.id
super(YourModel,self).save(*args,**kwargs)
Source:stackexchange.com