Improve view in lists

This commit is contained in:
Keannu Bernasol 2023-12-03 12:34:20 +08:00
parent c1ca024b4e
commit b4d177f8c3
2 changed files with 8 additions and 5 deletions

View file

@ -5,5 +5,7 @@ from simple_history.admin import SimpleHistoryAdmin
@admin.register(EquipmentGroup) @admin.register(EquipmentGroup)
class EquipmentGroupAdmin(SimpleHistoryAdmin): class EquipmentGroupAdmin(SimpleHistoryAdmin):
readonly_fields = ['status'] readonly_fields = ['status', 'dated_added',
list_display = ('name', 'status', 'date_added', 'last_updated') 'last_updated', 'last_updated_by']
list_display = ('name', 'status', 'date_added',
'last_updated', 'last_updated_by')

View file

@ -5,11 +5,12 @@ from .models import Equipment, EquipmentInstance
@admin.register(Equipment) @admin.register(Equipment)
class EquipmentAdmin(SimpleHistoryAdmin): class EquipmentAdmin(SimpleHistoryAdmin):
readonly_fields = ('date_added', 'last_updated') readonly_fields = ('date_added', 'last_updated', 'last_updated_by')
list_display = ('name', 'date_added', 'last_updated') list_display = ('name', 'date_added', 'last_updated', 'last_updated_by')
@admin.register(EquipmentInstance) @admin.register(EquipmentInstance)
class EquipmentInstanceAdmin(SimpleHistoryAdmin): class EquipmentInstanceAdmin(SimpleHistoryAdmin):
readonly_fields = ('date_added', 'last_updated', 'last_updated_by')
list_display = ('equipment', 'status', 'remarks', list_display = ('equipment', 'status', 'remarks',
'date_added', 'last_updated') 'date_added', 'last_updated', 'last_updated_by')