poulpe/equipment/admin.py
2018-07-26 15:53:42 +02:00

16 lines
374 B
Python

from django.contrib import admin
from .models import Equipment, EquipmentRemark
class EquipmentRemarkExtraInline(admin.TabularInline):
model = EquipmentRemark
extra = 0
class EquipmentAdmin(admin.ModelAdmin):
list_display = ['name', 'stock']
ordering = ['name']
inlines = [EquipmentRemarkExtraInline]
admin.site.register(Equipment, EquipmentAdmin)