Opened 18 years ago

Closed 18 years ago

#2517 closed enhancement (fixed)

[patch] add handling of column names with spaces to inspectdb

Reported by: Karen Tracey <graybark@…> Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: minor Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

inspectdb does not currently notice when a database table contains a column with embedded spaces in the name. Translating such a name directly to a field name causes a syntax error since a field name cannot contain spaces. I've got a patch that fixes this by simply removing the spaces in the generated name. db_column is set just as it is for DB column names that duplicate Python reserved words.

Attachments (1)

management.diff (730 bytes ) - added by Karen Tracey <graybark@…> 18 years ago.

Download all attachments as: .zip

Change History (3)

by Karen Tracey <graybark@…>, 18 years ago

Attachment: management.diff added

comment:1 by Karen Tracey <graybark@…>, 18 years ago

Forgot to mention I tested this patch against my own DB which has tables where some of the column names contain spaces. It seems to work properly.

comment:2 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [3549]) Fixed #2517 -- Improved inspectdb to handle table column names that contain spaces. Thanks, Karen Tracey

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