audit: add created field

This commit is contained in:
Jens Langhammer 2018-12-13 18:01:45 +01:00
parent 3267d7fb99
commit 32a73cbbf3
2 changed files with 21 additions and 0 deletions

View File

@ -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,
),
]

View File

@ -46,6 +46,7 @@ class AuditEntry(UUIDModel):
_context = models.TextField() _context = models.TextField()
_context_cache = None _context_cache = None
request_ip = models.GenericIPAddressField() request_ip = models.GenericIPAddressField()
created = models.DateTimeField(auto_now_add=True)
@property @property
def context(self): def context(self):