Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Imports
3from django.db import models
4from django.utils.translation import gettext_lazy as _
5from .fields import AutoNowAddDateTimeField, AutoNowDateTimeField
7# Exports
9__all__ = (
10 "TimeStampedModel",
11)
13# Models
16class TimeStampedModel(models.Model):
17 """A base model for creating a record that includes added and modified datetime stamps.
19 **Fields**
21 - ``added_dt``: The date and time the record was created.
22 - ``modified_dt``: The date and time the record was last modified.
24 """
26 added_dt = AutoNowAddDateTimeField(
27 _("added date/time"),
28 help_text=_("Date and time the record was created.")
29 )
31 modified_dt = AutoNowDateTimeField(
32 _("modified date/time"),
33 help_text=_("Date and time the record was last modified.")
34 )
36 class Meta:
37 abstract = True