Created
December 17, 2019 06:33
-
-
Save vikas-git/aac3267f2d064aa392615825ccef00a0 to your computer and use it in GitHub Desktop.
Use some common fields in every django modal
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 characters
from django.db import models | |
class AbstractDateTime(models.Model): | |
''' | |
Abstract model for created_on and updated_on field in models | |
''' | |
created_on = models.DateTimeField(auto_now_add=True) | |
updated_on = models.DateTimeField(auto_now=True) | |
class Meta: | |
abstract = True | |
class ModalName(AbstractDateTime): | |
a = models.CharField(max_length=50, null=True, blank=True) | |
class Meta: | |
db_table = 'ocean_fcl_rate' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment