我正在使用django import export
(DIE) 导入一些数据。我在导入数据时遇到问题。
我的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文件,例如:
但:
我想导入所有行。请告诉我如何忽略重复项。提前致谢!