Opened 9 years ago

Closed 9 years ago

#2517 closed enhancement (fixed)

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

Reported by: Karen Tracey <graybark@…> Owned by: adrian
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: UI/UX:

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@…> 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by Karen Tracey <graybark@…>

comment:1 Changed 9 years ago by Karen Tracey <graybark@…>

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 Changed 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(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