Opened 6 years ago

Closed 6 years ago

#12775 closed (fixed)

Enable `dumpdata --exclude app_label.model`

Reported by: emulbreh 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: UI/UX:


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@…> 6 years ago.
Add exclude model support, unit tests, update docs

Download all attachments as: .zip

Change History (7)

comment:1 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by SmileyChris

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

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

Add exclude model support, unit tests, update docs

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

  • Has patch set

Pretty straightforward.

comment:4 Changed 6 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 6 years ago by DrMeers

  • Triage Stage changed from Accepted to Ready for checkin

comment:6 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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