#14162 closed (fixed)
Dumpdata needs an option to use the base manager instead of the default manager
Reported by: | Paul McMillan | Owned by: | Paul McMillan |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Objects with custom managers sometimes filter results when dumpdata
is run. Often we want to dump all the objects in our database, not just the subset of objects which are returned by the default manager.
The attached patch adds a --all
option to the dumpdata
command which makes it use Django's base manager instead of the default manager. This means that even objects which would normally be filtered by the default manager are returned.
Attachments (1)
Change History (4)
by , 14 years ago
Attachment: | dumpdata_change.diff added |
---|
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
This patch looks good to me. It's got docs and tests, applies cleanly, respects multi-db, does something useful without cruft... I'll call this RFC until a core dev can take a look.
comment:2 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patches dumpdata to use _base_manager if --all is set. Includes tests and docs. Fixes a stray comment.