Register BuildItem in admin interface

This commit is contained in:
Oliver Walters 2019-04-30 16:35:40 +10:00
parent db5521f02e
commit fbd5a2a270

View File

@ -2,21 +2,33 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.contrib import admin from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from .models import Build from .models import Build, BuildItem
class BuildAdmin(admin.ModelAdmin): class BuildAdmin(ImportExportModelAdmin):
list_display = ('part', list_display = (
'status', 'part',
'batch', 'status',
'quantity', 'batch',
'creation_date', 'quantity',
'completion_date', 'creation_date',
'title', 'completion_date',
'notes', 'title',
) 'notes',
)
class BuildItemAdmin(admin.ModelAdmin):
list_display = (
'build',
'stock_item',
'quantity'
)
admin.site.register(Build, BuildAdmin) admin.site.register(Build, BuildAdmin)
admin.site.register(BuildItem, BuildItemAdmin)