Opened 16 years ago

Last modified 13 years ago

#7285 closed

inspectdb outputs invalid python variable when it encounters a dash — at Initial Version

Reported by: redalastor@… Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Keywords: inspectdb
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When inspectdb encounters a field with a dash, it outputs it as a variable name which is invalid in python. For instance, when i ran it, I got the line:

buy-back_amount = models.FloatField(null=True, blank=True)

which I had to manually change to:

buy_back_amount = models.FloatField(null=True, blank=True, db_column="buy-back")

This was found in the SVN version of django with a mysql database.

Change History (0)

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