Opened 16 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)

inspectdb.diff (167 bytes ) - added by mbeattie 16 years ago.
diff
inspectdb.txt (167 bytes ) - added by mbeattie 16 years ago.
diff

Download all attachments as: .zip

Change History (12)

by mbeattie, 16 years ago

Attachment: inspectdb.diff added

diff

by mbeattie, 16 years ago

Attachment: inspectdb.txt added

diff

comment:1 by mbeattie, 16 years ago

Has patch: set

comment:2 by Eric Holscher, 16 years ago

milestone: post-1.0
Triage Stage: UnreviewedDesign decision needed

comment:3 by (none), 15 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:4 by Malcolm Tredinnick, 14 years ago

Triage Stage: Design decision neededAccepted

Put a space after the "#" symbol for comments to produce reasonable Python style, but otherwise looks pretty good.

comment:5 by Luke Plant, 13 years ago

Needs tests: set
Patch needs improvement: set

Patch should be in unified diff form, and needs tests.

comment:6 by Gabriel Hurley, 13 years ago

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

comment:7 by Luke Plant, 13 years ago

Severity: Normal
Type: New feature

comment:8 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:9 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:10 by Claude Paroz, 12 years ago

Resolution: fixed
Status: newclosed

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.

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