Created
February 7, 2017 14:43
-
-
Save lightstrike/cffeb57fbe1412fc7e3ef66ab844db0d to your computer and use it in GitHub Desktop.
Abstract Base Django Model w/ DB Indexing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.utils.translation import ugettext_lazy as _ | |
from model_utils.fields import AutoCreatedField, AutoLastModifiedField | |
class IndexedTimeStampedModel(models.Model): | |
created = AutoCreatedField(_('created'), db_index=True) | |
modified = AutoLastModifiedField(_('modified'), db_index=True) | |
class Meta: | |
abstract = True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment