How to do it...

Open the models.py file of your utils package, and insert the following content there:

# utils/models.py
from django.db import models
from django.utils.translation import ugettext_lazy as _

class CreationModificationDateMixin(models.Model):
"""
Abstract base class with a creation
and modification date and time
"""
class Meta:
abstract = True

created = models.DateTimeField(
_("creation date and time"),
auto_now_add=True)
updated = models.DateTimeField(
_("modification date and time"),
auto_now=True)
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.202.167