show all item timestamps in timeline
All checks were successful
/ test (push) Successful in 2m32s
/ deploy (push) Successful in 4m24s

This commit is contained in:
j3d1 2025-02-09 18:32:00 +01:00
parent 9e0540d133
commit 1568252112
7 changed files with 313 additions and 22 deletions

View file

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