spradio-server-django/savepointradio/core/behaviors.py

15 lines
440 B
Python
Raw Normal View History

2017-12-27 21:11:20 +00:00
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
class Timestampable(models.Model):
2017-12-29 14:08:19 +00:00
"""
Mixin for keeping track of when an object was created and last modified.
"""
2017-12-27 21:11:20 +00:00
created_date = models.DateTimeField(_('added on'), auto_now_add=True)
modified_date = models.DateTimeField(_('last modified'), auto_now=True)
class Meta:
abstract = True