Opened 14 years ago

Closed 12 years ago

Last modified 11 years ago

#14305 closed New feature (fixed)

inspectdb should output unmanaged model definitions

Reported by: Erin Kelly Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords: inspectdb unmanaged
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm a little surprised that this hasn't been brought up before, but I couldn't find any existing tickets or discussion.

inspectdb should automatically set managed = False on the model definitions it creates. Since these are preexisting tables, the user almost certainly does not want Django attempting to drop them when a reset is run.

Attachments (1)

inspectdb-unmanaged.diff (439 bytes ) - added by Erin Kelly 14 years ago.

Download all attachments as: .zip

Change History (11)

by Erin Kelly, 14 years ago

Attachment: inspectdb-unmanaged.diff added

comment:1 by Ramiro Morales, 14 years ago

Has patch: set
Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedAccepted

Accepting on the basis this could mean user data is at risk and it is better to go with the safe choice. The additional work for the developer to remove the managed=False line would serve as an explicit opt in about allowing Django to handle the table.

Last edited 12 years ago by Ramiro Morales (previous) (diff)

comment:2 by Gabriel Hurley, 14 years ago

Component: django-admin.py inspectdbCore (Management commands)

comment:3 by Julien Phalip, 14 years ago

Severity: Normal
Type: New feature

comment:4 by Jacob, 13 years ago

milestone: 1.3

Milestone 1.3 deleted

comment:11 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:12 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:13 by Ramiro Morales <cramm0@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 08dc90bccf7c4ffa8b04064d74b54c1150af5ff9:

Fixed #14305 -- Switched inspectdb to create unmanaged models.

Thanks Ian Kelly for the report and initial patch.

comment:14 by Tim Graham <timograham@…>, 11 years ago

In 9b7ba8af1b4ddb539cd69cbec9645cd873db7624:

Fixed #22322 -- Fixed incorrect explanation of what managed=False does.

refs #14305.

Thanks Adrian Klaver for the report.

comment:15 by Tim Graham <timograham@…>, 11 years ago

In c0a9c2f72ac289b2ba8313c6a2c56be5ed94f01d:

[1.6.x] Fixed #22322 -- Fixed incorrect explanation of what managed=False does.

refs #14305.

Thanks Adrian Klaver for the report.

Backport of 9b7ba8af1b4ddb539cd69cbec9645cd873db7624 from master

comment:16 by Tim Graham <timograham@…>, 11 years ago

In 7eaf329ad38ff7ea6b47f1b0a3c20ca7a5ad079b:

[1.7.x] Fixed #22322 -- Fixed incorrect explanation of what managed=False does.

refs #14305.

Thanks Adrian Klaver for the report.

Backport of 9b7ba8af1b from master

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