#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)
Change History (3)
by , 14 years ago
Attachment: | dumpdata_managed.patch added |
---|
comment:1 by , 14 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
This is a duplicate of #13816.
comment:2 by , 14 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.
Patch to add checking of model._meta.managed to decide whether model should be dumped