2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-09 15:10:54 +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,13 +1,18 @@
from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from .models import Supplier, SupplierPart, Customer, Manufacturer
class CompanyAdmin(admin.ModelAdmin):
class CompanyAdmin(ImportExportModelAdmin):
list_display = ('name', 'website', 'contact')
class SupplierPartAdmin(ImportExportModelAdmin):
list_display = ('part', 'supplier', 'SKU')
admin.site.register(Customer, CompanyAdmin)
admin.site.register(Supplier, CompanyAdmin)
admin.site.register(Manufacturer, CompanyAdmin)
admin.site.register(SupplierPart)
admin.site.register(SupplierPart, SupplierPartAdmin)