Opened 12 years ago
Closed 9 years ago
#20468 closed New feature (fixed)
Allow loaddata to exclude some apps or models
| Reported by: | Wojciech Banaś | Owned by: | Alex Morozov |
|---|---|---|---|
| Component: | Core (Management commands) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | berker.peksag@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Would propose adding this option to the command loaddata:
-e EXCLUDE, --exclude=EXCLUDE
An appname or appname.ModelName to exclude (use
multiple --exclude to exclude multiple apps/models).
Sometimes it can be useful if you have a file with data from multiple applications / models, and we want to import only a portion of the data.
Change History (11)
comment:1 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 10 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
Seems useful. Recently I've faced a similar problem. Will give it a try.
comment:4 by , 10 years ago
Guys, I've got a somewhat meta question: Shall I always squash my minor fixes to PR and push --force them, or shall I leave them as separate commits? Which way is the preferred one?
comment:5 by , 10 years ago
If it's a huge PR, incremental commits can make follow up review easier. In this case, the patch looks small enough that you could squash right away.
comment:6 by , 10 years ago
Thank you, @timgraham. I've pushed the updated (and squashed) PR. All lights are green. It'd be nice if you review the code. I'm not sure about the source argument. Looks clumsy, but I haven't thought out another way of keeping the output compatibility. Is that OK?
comment:7 by , 10 years ago
| Cc: | added |
|---|---|
| Patch needs improvement: | set |
I left some review comments on GitHub.
comment:8 by , 10 years ago
| Patch needs improvement: | unset |
|---|
comment:9 by , 10 years ago
| Patch needs improvement: | set |
|---|
Left a few more comments and branch needs a rebase to merge cleanly.
comment:10 by , 9 years ago
| Patch needs improvement: | unset |
|---|---|
| Summary: | loaddata - during import exclude some applications → Allow loaddata to exclude some apps or models |
Updated PR from Berker.
I am going to mark this accepted. I don't feel strongly in one way or another about this issue, I just want to get this out of unreviewed triage stage.