Created
April 5, 2022 15:56
-
-
Save DataGreed/d45c97ef1f322b35c110320941fbe26f to your computer and use it in GitHub Desktop.
Revisions
-
DataGreed renamed this gist
Apr 5, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
DataGreed created this gist
Apr 5, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ class BaseModel(models.Model): """ Base abstract model that adds created and modified dates. Inherit from it when defining models. """ class Meta: abstract = True date_created = models.DateTimeField("Date Created", auto_now_add=True) date_modified = models.DateTimeField("Date Modified", auto_now=True)