Django Import-export. How can I check if one of the sku wish are going to be imported exist, that way it not going to create a new product but updated

from django.contrib import admin from .models import Product from import_export import resources from import_export.admin import ImportExportModelAdmin

class ProductResource(resources.ModelResource): class Meta: model = Product

class ProductAdmin(ImportExportModelAdmin, admin.ModelAdmin): search_fields = ['name','sku','parent','family'] list_display = ('id','sku','manufacturer','name','short_description','cost','price','price2','parent','family','nla',) list_filter = ('manufacturer',) resource_class = ProductResource, ProductAdmin)

the django admin is powerful for letting you perform CRUD actions

Back to Top