Opened 17 years ago
Closed 12 years ago
#7184 closed New feature (fixed)
inspectdb outputs primary key
Reported by: | mbeattie | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | inspectdb primary key |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
As noted in the djangobook http://new.djangobook.com/en/1.0/chapter16/ the inspectdb command outputs what are likely primary key fields as through they weren't. This simple change makes it insert them as comments.
Attachments (2)
Change History (12)
by , 17 years ago
Attachment: | inspectdb.diff added |
---|
comment:1 by , 17 years ago
Has patch: | set |
---|
comment:2 by , 16 years ago
milestone: | → post-1.0 |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:4 by , 14 years ago
Triage Stage: | Design decision needed → Accepted |
---|
Put a space after the "#" symbol for comments to produce reasonable Python style, but otherwise looks pretty good.
comment:5 by , 14 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
Patch should be in unified diff form, and needs tests.
comment:6 by , 14 years ago
Component: | django-admin.py inspectdb → Core (Management commands) |
---|
comment:7 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:10 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
As far as I understand the problem, inspectdb should now detect a "standard" primary key (id = model.AutoField(primary_key=True)
) and not ouptut it in that case.
If I missed an issue, feel free to reopen and provide a more concrete example.
diff