Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15967 closed New feature (duplicate)

dumpdata and "managed" flag on models

Reported by: ijstokes Owned by: nobody
Component: Uncategorized Version: master
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:

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 4 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)

Changed 4 years ago by ijstokes

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

comment:1 Changed 4 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #13816.

Last edited 4 years ago by aaugustin (previous) (diff)

comment:2 Changed 4 years ago by kmtracey

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