feat: add optional django-import-export with generic FK-context import support#6603
Open
gourav-sraoss wants to merge 2 commits into
Open
feat: add optional django-import-export with generic FK-context import support#6603gourav-sraoss wants to merge 2 commits into
gourav-sraoss wants to merge 2 commits into
Conversation
Member
|
I used django-import-export in a few project, but I'm not convinced it should be added to the template. While making it a project option could be a good compromise, a new option always adds complexity in terms of testing, and adds a question when people generate a new project. At this stage, I don't think it's worth it, but I will leave this open for while to let people give feedback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds an opt-in
django-import-exportintegration to generated projects, including a reusable contrib package that solves a common pain point: selecting one FK value once in the import wizard and having it automatically applied to every imported row — without requiring that column in every line of the CSV file.Default behaviour is unchanged (
"use_django_import_export": "n").Motivation
Admin-side CSV import/export is one of the most frequently needed features for operational Django projects — data migrations, bulk updates, support workflows. Yet wiring it up correctly (especially the shared-FK pattern) requires boilerplate that every team re-writes. This PR gives generated projects the integration out of the box, and eliminates that boilerplate entirely via a two-class contrib package.
What changed (2 commits, 5 files changed, 185 insertions)
1 — Template option and app wiring
cookiecutter.jsonuse_django_import_export(defaultn)pyproject.tomldjango-import-exportdependencyconfig/settings/base.pyimport_exporttoTHIRD_PARTY_APPS2 — Generic FK-context contrib package
When the option is enabled, the generated project gains a ready-to-use contrib package: