Jan 26, 2018 · by Tim Kamanin
I'm leaving this to my future self, as I keep forgetting it over and over again.
If you want to add "create" and "update" time logging to your model, it's as simple as:
from django.db import models class Task(models.Model): created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True)
Hey, if you've found this useful, please share the post to help other folks find it: