First version
This commit is contained in:
20
polyclinic_scheduling/lib/models/base.py
Normal file
20
polyclinic_scheduling/lib/models/base.py
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
class MetaDataModel(models.Model):
|
||||
"""
|
||||
This is an abstract model with some general meta fields.
|
||||
|
||||
Attributes
|
||||
----------
|
||||
created_at : datetime
|
||||
The date and time when the model has been created. This will be automatically set once during creating.
|
||||
updated_at : datetime
|
||||
The date and time when the model has been updated. This will be automatically updated when the model is updated.
|
||||
"""
|
||||
created_at = models.DateTimeField(_('Date created'),auto_now_add=True, help_text=_('The date and time this model has been created'))
|
||||
updated_at = models.DateTimeField(_('Date updated'),auto_now=True, help_text=_('The date and time this model has been updated'))
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
Reference in New Issue
Block a user