From d507e8f7acc015789e662a9fd065c4e9e8ff598b Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 20 Jun 2015 10:22:49 -0500 Subject: [PATCH] facts: add the timestamp back too --- dr_botzo/facts/migrations/0004_fact_time.py | 22 +++++++++++++++++++++ dr_botzo/facts/models.py | 1 + 2 files changed, 23 insertions(+) create mode 100644 dr_botzo/facts/migrations/0004_fact_time.py diff --git a/dr_botzo/facts/migrations/0004_fact_time.py b/dr_botzo/facts/migrations/0004_fact_time.py new file mode 100644 index 0000000..e36483a --- /dev/null +++ b/dr_botzo/facts/migrations/0004_fact_time.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import datetime +from django.utils.timezone import utc + + +class Migration(migrations.Migration): + + dependencies = [ + ('facts', '0003_auto_20150620_1018'), + ] + + operations = [ + migrations.AddField( + model_name='fact', + name='time', + field=models.DateTimeField(default=datetime.datetime(2015, 6, 20, 15, 22, 20, 481856, tzinfo=utc), auto_now_add=True), + preserve_default=False, + ), + ] diff --git a/dr_botzo/facts/models.py b/dr_botzo/facts/models.py index 0f36f2a..672c1bf 100644 --- a/dr_botzo/facts/models.py +++ b/dr_botzo/facts/models.py @@ -56,6 +56,7 @@ class Fact(models.Model): fact = models.TextField() category = models.ForeignKey(FactCategory) nickmask = models.CharField(max_length=200, default='') + time = models.DateTimeField(auto_now_add=True) objects = FactManager()