From b4d177f8c323c639fa46e7c7b39dd598892e89d8 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sun, 3 Dec 2023 12:34:20 +0800 Subject: [PATCH] Improve view in lists --- equipment_tracker/equipment_groups/admin.py | 6 ++++-- equipment_tracker/equipments/admin.py | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/equipment_tracker/equipment_groups/admin.py b/equipment_tracker/equipment_groups/admin.py index 6d19b5a..007a018 100644 --- a/equipment_tracker/equipment_groups/admin.py +++ b/equipment_tracker/equipment_groups/admin.py @@ -5,5 +5,7 @@ from simple_history.admin import SimpleHistoryAdmin @admin.register(EquipmentGroup) class EquipmentGroupAdmin(SimpleHistoryAdmin): - readonly_fields = ['status'] - list_display = ('name', 'status', 'date_added', 'last_updated') + readonly_fields = ['status', 'dated_added', + 'last_updated', 'last_updated_by'] + list_display = ('name', 'status', 'date_added', + 'last_updated', 'last_updated_by') diff --git a/equipment_tracker/equipments/admin.py b/equipment_tracker/equipments/admin.py index d099ead..b91ad3d 100644 --- a/equipment_tracker/equipments/admin.py +++ b/equipment_tracker/equipments/admin.py @@ -5,11 +5,12 @@ from .models import Equipment, EquipmentInstance @admin.register(Equipment) class EquipmentAdmin(SimpleHistoryAdmin): - readonly_fields = ('date_added', 'last_updated') - list_display = ('name', 'date_added', 'last_updated') + readonly_fields = ('date_added', 'last_updated', 'last_updated_by') + list_display = ('name', 'date_added', 'last_updated', 'last_updated_by') @admin.register(EquipmentInstance) class EquipmentInstanceAdmin(SimpleHistoryAdmin): + readonly_fields = ('date_added', 'last_updated', 'last_updated_by') list_display = ('equipment', 'status', 'remarks', - 'date_added', 'last_updated') + 'date_added', 'last_updated', 'last_updated_by')