Skip to content

Conversation

@PetrDlouhy
Copy link
Contributor

@PetrDlouhy PetrDlouhy commented Jul 29, 2024

This is concept of possible fix for #111. It adds possibility to specify the queryset by filter parameters instead of just list of PKs.

Specifying export querysets by filters might be very beneficial in cases when the same export needs to run on regular basis (e.g. monthly) or executed multiple times with changed parameters.

Few issues to decide:

  1. The export queryset in original django-import-export is specified by ModelAdmin filters, these are querset filters.
  2. It would be nice if this export job could be created from the django-import-export workflow (for example by adding second button "Export with Celery job" beside "Submit" in the export view, but the difference from 1. complicates it.
  3. It is also complicated, because django-import-export-celery uses ModelResource.get_export_queryset() which might have different annotations than ModelAdmin.get_queryset() and thus the same filters might not work.

I also converted the queryset field to JSONField because it has much better data validation, but I can take that change back or introduce in separate PR.

@PetrDlouhy PetrDlouhy force-pushed the queryset_by_filters branch from 53b53d1 to 7c4c8d2 Compare August 19, 2024 07:23
@PetrDlouhy PetrDlouhy marked this pull request as ready for review November 24, 2025 15:48
@PetrDlouhy PetrDlouhy changed the title Conceptual fix for #111 (add possibility to specify queryset by filters) Fix for #111 (add possibility to specify queryset by filters) Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants