spradio-server-django/savepointradio/core/behaviors.py
2017-12-29 09:08:19 -05:00

14 lines
440 B
Python

from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
class Timestampable(models.Model):
"""
Mixin for keeping track of when an object was created and last modified.
"""
created_date = models.DateTimeField(_('added on'), auto_now_add=True)
modified_date = models.DateTimeField(_('last modified'), auto_now=True)
class Meta:
abstract = True