Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#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: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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)

dumpdata_change.diff (5.9 KB) - added by Paul McMillan 6 years ago.
Patches dumpdata to use _base_manager if --all is set. Includes tests and docs. Fixes a stray comment.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Paul McMillan

Attachment: dumpdata_change.diff added

Patches dumpdata to use _base_manager if --all is set. Includes tests and docs. Fixes a stray comment.

comment:1 Changed 6 years ago by Gabriel Hurley

Triage Stage: UnreviewedReady 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 Changed 6 years ago by Luke Plant

Resolution: fixed
Status: newclosed

(In [13669]) Fixed #14162 - Dumpdata needs an option to use the base manager instead of the default manager

Thanks to PaulM for suggestion and patch.

comment:3 Changed 5 years ago by Jacob

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top