Conceptual fix for #111 (add possibility to specify queryset by filters) #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
django-import-export
is specified byModelAdmin
filters, these are querset filters.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.django-import-export-celery
usesModelResource.get_export_queryset()
which might have different annotations thanModelAdmin.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.