I’m using django as the edit interface for a database, and want to track the last edit. I’ve got the following class
class CommonInformation(models.Model):
lastEditedOn = models.DateTimeField(auto_now_add=True,null = True, blank=True)
lastEditedby = models.ForeignKey(Person,null = True, blank=True)
class Meta:
abstract = True
which I can use to track the edit date, but is there a way to make it automatically store the username of the person logged onto the admin site instead of having to manually select the name each time?
for the admin site you can use save_model in your admin file e.g.