0
我正在使用django import export
(DIE)導入一些數據。我在導入數據時遇到問題。Django Excel數據導入導出
我admin.py:
class TestResource(resources.ModelResource):
class Meta:
model = Test
exclude = ('id',)
import_id_fields = ['VS',]
skip_unchanged = True
class TestAdmin(ImportExportMixin,admin.ModelAdmin):
fieldsets = [
('VS', {'fields':['VS']}),
('pool', {'fields':['pool']}),
('pool_port', {'fields':['pool_port']}),
('idc', {'fields':['idc']})
]
list_display = ('VS','pool','pool_port','idc')
list_filter = ['pool_port']
search_fields = ['VS','pool','pool_port','idc']
resource_class = TestResource
admin.site.register(Test,TestAdmin)
我想導入Excel文件,如:
但是:
我想導入所有行。請告訴我如何忽略重複。提前致謝!
@ api55思的指正。 –