diff --git a/core/migrations/0003_auto_20161101_1457.py b/core/migrations/0003_auto_20161101_1457.py new file mode 100644 index 0000000..4d94e07 --- /dev/null +++ b/core/migrations/0003_auto_20161101_1457.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10 on 2016-11-01 17:57 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0002_auto_20161024_1559'), + ] + + operations = [ + migrations.AddField( + model_name='log', + name='component', + field=models.TextField(default='', verbose_name='Component (Module / App)'), + preserve_default=False, + ), + migrations.AddField( + model_name='log', + name='context', + field=models.TextField(blank=True, verbose_name='Context'), + ), + ] diff --git a/core/models.py b/core/models.py index e5a90ea..cb3013e 100644 --- a/core/models.py +++ b/core/models.py @@ -101,10 +101,15 @@ class Notification(models.Model): return self.message class Log(models.Model): - datetime = models.DateTimeField(_("Date and Time of action"), auto_now_add = True) - user = models.ForeignKey(User, verbose_name = _('Actor')) + component = models.TextField(_('Component (Module / App)')) + context = models.TextField(_('Context'), blank = True) action_resource = models.ForeignKey(Action_Resource, verbose_name = _('Action_Resource')) + user = models.ForeignKey(User, verbose_name = _('Actor')) + datetime = models.DateTimeField(_("Date and Time of action"), auto_now_add = True) class Meta: verbose_name = _('Log') verbose_name_plural = _('Logs') + + def __str__(self): + return self.message -- libgit2 0.21.2