2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

Use django_import_export

- Allows import / export to multiple file formats
- Provides admin interface
- Work to be done to perform data tweaking
- It would be really cool if the data fields could be associated 'intelligently'
 (i.e. not just based on PK, but name-lookup too).
This commit is contained in:
Oliver
2018-04-16 00:44:32 +10:00
parent 8e6de1b832
commit 1027e812bc
4 changed files with 19 additions and 5 deletions

View File

@ -1,10 +1,12 @@
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from .models import PartCategory, Part
from .models import BomItem
from .models import PartAttachment
class PartAdmin(admin.ModelAdmin):
#class PartAdmin(admin.ModelAdmin):
class PartAdmin(ImportExportModelAdmin):
list_display = ('name', 'IPN', 'description', 'stock', 'category')
@ -13,7 +15,8 @@ class PartCategoryAdmin(admin.ModelAdmin):
list_display = ('name', 'pathstring', 'description')
class BomItemAdmin(admin.ModelAdmin):
#class BomItemAdmin(admin.ModelAdmin):
class BomItemAdmin(ImportExportModelAdmin):
list_display=('part', 'sub_part', 'quantity')
class PartAttachmentAdmin(admin.ModelAdmin):