Opened 16 years ago
Closed 11 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)
Changed 16 years ago by
Attachment: | inspectdb.diff added |
---|
comment:1 Changed 16 years ago by
Has patch: | set |
---|
comment:2 Changed 15 years ago by
milestone: | → post-1.0 |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:4 Changed 13 years ago by
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 Changed 13 years ago by
Needs tests: | set |
---|---|
Patch needs improvement: | set |
Patch should be in unified diff form, and needs tests.
comment:6 Changed 13 years ago by
Component: | django-admin.py inspectdb → Core (Management commands) |
---|
comment:7 Changed 13 years ago by
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:10 Changed 11 years ago by
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