mirror of
https://github.com/lemeow125/EquipmentTracker-Backend.git
synced 2024-11-17 06:09:26 +08:00
Improved admin panel for equipment and equipment groups
This commit is contained in:
parent
03a4e07f7f
commit
d6efa30759
2 changed files with 12 additions and 3 deletions
|
@ -5,5 +5,5 @@ from simple_history.admin import SimpleHistoryAdmin
|
||||||
|
|
||||||
@admin.register(EquipmentGroup)
|
@admin.register(EquipmentGroup)
|
||||||
class EquipmentGroupAdmin(SimpleHistoryAdmin):
|
class EquipmentGroupAdmin(SimpleHistoryAdmin):
|
||||||
readonly_fields = ('status',)
|
readonly_fields = ['status']
|
||||||
list_display = ('name', 'status', 'date_added', 'last_updated')
|
list_display = ('name', 'status', 'date_added', 'last_updated')
|
||||||
|
|
|
@ -2,5 +2,14 @@ from django.contrib import admin
|
||||||
from simple_history.admin import SimpleHistoryAdmin
|
from simple_history.admin import SimpleHistoryAdmin
|
||||||
from .models import Equipment, EquipmentInstance
|
from .models import Equipment, EquipmentInstance
|
||||||
|
|
||||||
admin.site.register(Equipment, SimpleHistoryAdmin)
|
|
||||||
admin.site.register(EquipmentInstance, SimpleHistoryAdmin)
|
@admin.register(Equipment)
|
||||||
|
class EquipmentAdmin(SimpleHistoryAdmin):
|
||||||
|
readonly_fields = ('date_added', 'last_updated')
|
||||||
|
list_display = ('name', 'date_added', 'last_updated')
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(EquipmentInstance)
|
||||||
|
class EquipmentInstanceAdmin(SimpleHistoryAdmin):
|
||||||
|
list_display = ('equipment', 'status', 'remarks',
|
||||||
|
'date_added', 'last_updated')
|
||||||
|
|
Loading…
Reference in a new issue