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

@ -132,6 +132,22 @@ class ItemSerializer(BasicItemSerializer):
'cid': placement.container.id,
'box': placement.container.name
})
if obj.created_at:
timeline.append({
'type': 'created',
'timestamp': obj.created_at,
})
if obj.returned_at:
timeline.append({
'type': 'returned',
'timestamp': obj.returned_at,
})
if obj.deleted_at:
timeline.append({
'type': 'deleted',
'timestamp': obj.deleted_at,
})
return sorted(timeline, key=lambda x: x['timestamp'])