Skip to content

Instantly share code, notes, and snippets.

@jairajsahgal
Created October 2, 2023 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jairajsahgal/60c0039dd48d4ed24d4c72b3f55d62d3 to your computer and use it in GitHub Desktop.
Save jairajsahgal/60c0039dd48d4ed24d4c72b3f55d62d3 to your computer and use it in GitHub Desktop.
time based stamp abstract model
from django.db import models
class TimeStampedModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment