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:
@ -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)
|
||||
|
Reference in New Issue
Block a user