@admin.register(Company)
class CompanyAmin(ImportExportModelAdmin):
resource_class = CompanyResource
list_display = ('domain', 'website', 'exported', 'added_on')
list_filter = ('user', 'country', 'imported', 'exported', 'added_on')
def export_action(self, request, *args, **kwargs):
response = super().export_action(request, *args, **kwargs)
qs = self.get_export_queryset(request)
qs.update(exported=True)
return response
class CompanyResource(resources.ModelResource):
class Meta:
model = Company
fields = ('website', 'user', 'country', 'source', 'industry')
def after_export(self, queryset, data, *args, **kwargs):
queryset.update(exported=True)