Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#15967 closed New feature (duplicate)

dumpdata and "managed" flag on models

Reported by: ijstokes Owned by: nobody
Component: Uncategorized Version: dev
Severity: Normal Keywords: dumpdata managed
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Should "dumpdata" process models which are flagged with "managed = False"? My sense is no it shouldn't, and if so the attached patch (against latest SVN) will correct this.

It looks like there is some "exclude" mechanism which can be used to skip certain models, but I don't see how to invoke that from the command line. Perhaps it is an undocumented feature.

Attachments (1)

dumpdata_managed.patch (625 bytes ) - added by ijstokes 13 years ago.
Patch to add checking of model._meta.managed to decide whether model should be dumped

Download all attachments as: .zip

Change History (3)

by ijstokes, 13 years ago

Attachment: dumpdata_managed.patch added

Patch to add checking of model._meta.managed to decide whether model should be dumped

comment:1 by Aymeric Augustin, 13 years ago

Resolution: duplicate
Status: newclosed

This is a duplicated of #13816.

Version 0, edited 13 years ago by Aymeric Augustin (next)

comment:2 by Karen Tracey, 13 years ago

The documentation for managed (http://docs.djangoproject.com/en/1.3/ref/models/options/#managed) explicitly states its only effect is on creation/deletion of tables; I don't understand where the idea that dumpdata would pay some special attention to managed=False models and ignore those comes from?

--exclude is also documented for dumpdata: http://docs.djangoproject.com/en/1.3/ref/django-admin/#dumpdata-appname-appname-appname-model, though the formatting where some options have headers and others do not perhaps is obscuring its existence (and that may be worthy of a ticket). In any case, it is a documented command line flag. Description of what it supports, exactly, is both in the doc and in the manage.py help dumpdata output, so I don't understand where the idea it is some undocumented internal feature came from either.

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