From 32a73cbbf31c102d047fc7eda137cc325366cb74 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 13 Dec 2018 18:01:45 +0100 Subject: [PATCH] audit: add created field --- .../migrations/0005_auditentry_created.py | 20 +++++++++++++++++++ passbook/audit/models.py | 1 + 2 files changed, 21 insertions(+) create mode 100644 passbook/audit/migrations/0005_auditentry_created.py diff --git a/passbook/audit/migrations/0005_auditentry_created.py b/passbook/audit/migrations/0005_auditentry_created.py new file mode 100644 index 000000000..5ee9c9118 --- /dev/null +++ b/passbook/audit/migrations/0005_auditentry_created.py @@ -0,0 +1,20 @@ +# Generated by Django 2.1.4 on 2018-12-11 15:00 + +import django.utils.timezone +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('passbook_audit', '0004_auto_20181210_1348'), + ] + + operations = [ + migrations.AddField( + model_name='auditentry', + name='created', + field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now), + preserve_default=False, + ), + ] diff --git a/passbook/audit/models.py b/passbook/audit/models.py index da9b4ab07..3c957f515 100644 --- a/passbook/audit/models.py +++ b/passbook/audit/models.py @@ -46,6 +46,7 @@ class AuditEntry(UUIDModel): _context = models.TextField() _context_cache = None request_ip = models.GenericIPAddressField() + created = models.DateTimeField(auto_now_add=True) @property def context(self):