Borrowing-TrackerBackend/equipment_tracker/equipments/admin.py

17 lines
636 B
Python
Raw Normal View History

from django.contrib import admin
from simple_history.admin import SimpleHistoryAdmin
from .models import Equipment, EquipmentInstance
@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')
@admin.register(EquipmentInstance)
class EquipmentInstanceAdmin(SimpleHistoryAdmin):
2023-12-03 12:34:20 +08:00
readonly_fields = ('date_added', 'last_updated', 'last_updated_by')
list_display = ('equipment', 'status', 'remarks',
2023-12-03 12:34:20 +08:00
'date_added', 'last_updated', 'last_updated_by')