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)

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)

Changed 16 years ago by mbeattie

Attachment: inspectdb.diff added

diff

Changed 16 years ago by mbeattie

Attachment: inspectdb.txt added

diff

comment:1 Changed 16 years ago by mbeattie

Has patch: set

comment:2 Changed 15 years ago by Eric Holscher

milestone: post-1.0
Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 15 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:4 Changed 13 years ago by Malcolm Tredinnick

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 Changed 13 years ago by Luke Plant

Needs tests: set
Patch needs improvement: set

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

comment:6 Changed 13 years ago by Gabriel Hurley

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

comment:7 Changed 13 years ago by Luke Plant

Severity: Normal
Type: New feature

comment:8 Changed 12 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:9 Changed 12 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:10 Changed 11 years ago by Claude Paroz

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