# Imports
from django.db import models
from django.utils.translation import gettext_lazy as _
from .fields import AutoNowAddDateTimeField, AutoNowDateTimeField
# Exports
__all__ = (
"TimeStampedModel",
)
# Models
[docs]class TimeStampedModel(models.Model):
"""A base model for creating a record that includes added and modified datetime stamps.
**Fields**
- ``added_dt``: The date and time the record was created.
- ``modified_dt``: The date and time the record was last modified.
"""
added_dt = AutoNowAddDateTimeField(
_("added date/time"),
help_text=_("Date and time the record was created.")
)
modified_dt = AutoNowDateTimeField(
_("modified date/time"),
help_text=_("Date and time the record was last modified.")
)
class Meta:
abstract = True