Commit e39a332b12b61ba340a78355ce3002e903aa8629
1 parent
7e7a184c
Exists in
master
and in
5 other branches
Issue #37
Showing
1 changed file
with
11 additions
and
5 deletions
Show diff stats
core/models.py
| @@ -3,9 +3,6 @@ from django.utils.translation import ugettext_lazy as _ | @@ -3,9 +3,6 @@ from django.utils.translation import ugettext_lazy as _ | ||
| 3 | from users.models import User | 3 | from users.models import User |
| 4 | # Create your models here. | 4 | # Create your models here. |
| 5 | 5 | ||
| 6 | - | ||
| 7 | - | ||
| 8 | - | ||
| 9 | class Action(models.Model): | 6 | class Action(models.Model): |
| 10 | """ | 7 | """ |
| 11 | It represents an Action on the program by a User such as "create post", | 8 | It represents an Action on the program by a User such as "create post", |
| @@ -59,8 +56,8 @@ class Action_Resource(models.Model): | @@ -59,8 +56,8 @@ class Action_Resource(models.Model): | ||
| 59 | 56 | ||
| 60 | class Notification(models.Model): | 57 | class Notification(models.Model): |
| 61 | message = models.TextField(_('message')) | 58 | message = models.TextField(_('message')) |
| 62 | - user = models.ForeignKey(User, verbose_name= _('Actor')) | ||
| 63 | - read = models.BooleanField(_('Read'), default=False) | 59 | + user = models.ForeignKey(User, verbose_name = _('Actor')) |
| 60 | + read = models.BooleanField(_('Read'), default = False) | ||
| 64 | action_resource = models.ForeignKey(Action_Resource, verbose_name = _('Action_Resource')) | 61 | action_resource = models.ForeignKey(Action_Resource, verbose_name = _('Action_Resource')) |
| 65 | 62 | ||
| 66 | class Meta: | 63 | class Meta: |
| @@ -69,3 +66,12 @@ class Notification(models.Model): | @@ -69,3 +66,12 @@ class Notification(models.Model): | ||
| 69 | 66 | ||
| 70 | def __str__(self): | 67 | def __str__(self): |
| 71 | pass | 68 | pass |
| 69 | + | ||
| 70 | +class Log(models.Model): | ||
| 71 | + datetime = models.DateTimeField(_("Date and Time"), auto_now_add = True) | ||
| 72 | + user = models.ForeignKey(User, verbose_name = _('Actor')) | ||
| 73 | + action_resource = models.ForeignKey(Action_Resource, verbose_name = _('Action_Resource')) | ||
| 74 | + | ||
| 75 | + class Meta: | ||
| 76 | + verbose_name = _('Log') | ||
| 77 | + verbose_name_plural = _('Logs') |