2023-11-12 21:45:39 +08:00
|
|
|
from django.contrib import admin
|
2023-11-12 22:10:54 +08:00
|
|
|
from simple_history.admin import SimpleHistoryAdmin
|
2023-11-12 21:45:39 +08:00
|
|
|
from .models import Equipment, EquipmentInstance
|
|
|
|
|
2023-11-13 18:02:05 +08:00
|
|
|
|
|
|
|
@admin.register(Equipment)
|
|
|
|
class EquipmentAdmin(SimpleHistoryAdmin):
|
2023-12-03 12:34:20 +08:00
|
|
|
readonly_fields = ('date_added', 'last_updated', 'last_updated_by')
|
|
|
|
list_display = ('name', 'date_added', 'last_updated', 'last_updated_by')
|
2023-11-13 18:02:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
@admin.register(EquipmentInstance)
|
|
|
|
class EquipmentInstanceAdmin(SimpleHistoryAdmin):
|
2023-12-03 12:34:20 +08:00
|
|
|
readonly_fields = ('date_added', 'last_updated', 'last_updated_by')
|
2023-11-13 18:02:05 +08:00
|
|
|
list_display = ('equipment', 'status', 'remarks',
|
2023-12-03 12:34:20 +08:00
|
|
|
'date_added', 'last_updated', 'last_updated_by')
|