Hello @kartik,
Only change your pub_date if published has been modified from False to True:
from datetime import datetime
def __init__(self, *args, **kwargs):
super(MyModel, self).__init__(*args, **kwargs)
self.old_published = self.published
def save(self, *args, **kwargs):
if self.published and self.old_published != self.published:
self.pub_date = datetime.now()
super(Model, self).save(*args, **kwargs)
Hope it helps!
Thanks!