django date time fields that don't break like auto_now and auto_now_add do
install the python package with pip
pip install django-AutoDateTimeFields
or install manually
python setup.py install
add autodatetimefields to installed apps setting:
INSTALLED_APPS = (
...
'autodatetimefields'
)
from autodatetimefields.models import AutoNewDateTimeField, AutoDateTimeField
class ModelName(models.Model):
date_created = AutoNewDateTimeField(blank=True)
date_updated = AutoDateTimeField(blank=True)
James Marlowe https://github.com/jamesmarlowe