Opened 15 years ago

Closed 14 years ago

#12775 closed (fixed)

Enable `dumpdata --exclude app_label.model`

Reported by: Johannes Dollinger Owned by: nobody
Component: Core (Serialization) Version: dev
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

Description

Currently, django-admin.py 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@…> 14 years ago.
Add exclude model support, unit tests, update docs

Download all attachments as: .zip

Change History (7)

comment:1 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Chris Beaven, 15 years ago

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

by Joshua Ginsberg <jag@…>, 14 years ago

Attachment: django-12775.diff added

Add exclude model support, unit tests, update docs

comment:3 by Joshua Ginsberg <jag@…>, 14 years ago

Has patch: set

Pretty straightforward.

comment:4 by Goldan, 14 years ago

Joshua,
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 by Simon Meers, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Russell Keith-Magee, 14 years ago

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