show all item timestamps in timeline
This commit is contained in:
parent
9e0540d133
commit
1568252112
7 changed files with 313 additions and 22 deletions
|
@ -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'])
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue