Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conceptual fix for #111 (add possibility to specify queryset by filters) #130

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.

1 participant