Answers for "post_export signals"

0

post_export signals

@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
Posted by: Guest on April-27-2021
0

post_export signals

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)
Posted by: Guest on April-27-2021

Browse Popular Code Answers by Language