Hide keyboard shortcuts

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 

2 

3from django.db import models 

4from django.utils.translation import gettext_lazy as _ 

5from .fields import AutoNowAddDateTimeField, AutoNowDateTimeField 

6 

7# Exports 

8 

9__all__ = ( 

10 "TimeStampedModel", 

11) 

12 

13# Models 

14 

15 

16class TimeStampedModel(models.Model): 

17 """A base model for creating a record that includes added and modified datetime stamps. 

18 

19 **Fields** 

20 

21 - ``added_dt``: The date and time the record was created. 

22 - ``modified_dt``: The date and time the record was last modified. 

23 

24 """ 

25 

26 added_dt = AutoNowAddDateTimeField( 

27 _("added date/time"), 

28 help_text=_("Date and time the record was created.") 

29 ) 

30 

31 modified_dt = AutoNowDateTimeField( 

32 _("modified date/time"), 

33 help_text=_("Date and time the record was last modified.") 

34 ) 

35 

36 class Meta: 

37 abstract = True