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:38:37 +08:00
|
|
|
readonly_fields = ('date_added', 'last_updated')
|
2023-12-27 18:36:52 +08:00
|
|
|
list_display = ('id', 'name', 'date_added', 'last_updated')
|
2023-11-13 18:02:05 +08:00
|
|
|
|
|
|
|
|
|
|
|
@admin.register(EquipmentInstance)
|
|
|
|
class EquipmentInstanceAdmin(SimpleHistoryAdmin):
|
2023-12-03 12:38:37 +08:00
|
|
|
readonly_fields = ('date_added', 'last_updated')
|
2023-12-27 18:36:52 +08:00
|
|
|
list_display = ('id', 'equipment', 'status', 'remarks',
|
2023-12-03 12:38:37 +08:00
|
|
|
'date_added', 'last_updated')
|