inspectdb should output unmanaged model definitions
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.
Change History
(11)
Has patch: |
set
|
Needs documentation: |
set
|
Needs tests: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Component: |
django-admin.py inspectdb → Core (Management commands)
|
Severity: |
→ Normal
|
Type: |
→ New feature
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
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.