show all item timestamps in timeline
This commit is contained in:
parent
9e0540d133
commit
1568252112
7 changed files with 313 additions and 22 deletions
|
@ -1,6 +1,9 @@
|
|||
from itertools import groupby
|
||||
|
||||
from django.db import models
|
||||
from django.db.models.signals import pre_save
|
||||
from django.dispatch import receiver
|
||||
from django.utils import timezone
|
||||
from django_softdelete.models import SoftDeleteModel, SoftDeleteManager
|
||||
|
||||
|
||||
|
@ -64,6 +67,11 @@ class Item(SoftDeleteModel):
|
|||
return '[' + str(self.id) + ']' + self.description
|
||||
|
||||
|
||||
@receiver(pre_save, sender=Item)
|
||||
def item_updated(sender, instance, **kwargs):
|
||||
instance.updated_at = timezone.now()
|
||||
|
||||
|
||||
class Container(SoftDeleteModel):
|
||||
id = models.AutoField(primary_key=True)
|
||||
name = models.CharField(max_length=255)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue