Opened 9 years ago

Closed 8 years ago

#12775 closed (fixed)

Enable `dumpdata --exclude app_label.model`

Reported by: Johannes Dollinger Owned by: nobody
Component: Core (Serialization) Version: master
Severity: Keywords: dumpdata exclude
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


Currently, dumpdata can only exclude whole apps. It would be useful if it supported exclusion of indiviual models with --exclude app_label.model.

Attachments (1)

django-12775.diff (11.2 KB) - added by Joshua Ginsberg <jag@…> 8 years ago.
Add exclude model support, unit tests, update docs

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by Alex Gaynor

Triage Stage: UnreviewedAccepted

comment:2 Changed 8 years ago by Chris Beaven

Specifically, this would be useful for excluding auto-generated permissions while still allowing auth.User to be serialized.

Changed 8 years ago by Joshua Ginsberg <jag@…>

Attachment: django-12775.diff added

Add exclude model support, unit tests, update docs

comment:3 Changed 8 years ago by Joshua Ginsberg <jag@…>

Has patch: set

Pretty straightforward.

comment:4 Changed 8 years ago by Goldan

Thanks for a great patch, works perfectly! And as SmileyChris pointed, it is especially useful for dumping/loading data, since it enables dumping omitting only the contenttypes app and the auth.Permission model, and in combination with natural keys it makes it possible to fully automate dumping/loading procedure.

comment:5 Changed 8 years ago by Simon Meers

Triage Stage: AcceptedReady for checkin

comment:6 Changed 8 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [13511]) Fixed #12775 -- Modified the --exclude argument to dumpdata to allow exclusion of individual models. Thanks to emulbreh for the suggestion, and Joshua Ginsberg for the patch.

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