dkoug Blog

Django Timestamped Model

Django -- Posted on Sept. 28, 2017

Django timestamped model

1
2
3
4
5
6
class Timestamped(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    class Meta:
        abstract = True