Opened 14 years ago

Closed 14 years ago

Last modified 13 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: 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)

dumpdata_change.diff (5.9 KB ) - added by Paul McMillan 14 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)

by Paul McMillan, 14 years ago

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 by Gabriel Hurley, 14 years ago

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 by Luke Plant, 14 years ago

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 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

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