Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#7536 closed (fixed)

mysql inspectdb unable to handle newdecimal

Reported by: Jerome Etienne <jerome.etienne@…> Owned by: nobody
Component: django-admin.py inspectdb Version: dev
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Description:
doing inspectdb on a mysql newdecimal field is converted as a TextField instead of a decimal.

mysql 5 got a type "newdecimal" MYSQL_TYPE_NEWDECIMAL) and this is not handled by django inspectdb.

DATA_TYPES_REVERSE in mysql introspection.py doesnt contains the FIELD_TYPE.NEWDECIMAL from mysqldb-python. So in DATA_TYPE_REVERSE, i just added

    FIELD_TYPE.NEWDECIMAL: 'DecimalField',

the patch is attached

Attachments (1)

patch_django (417 bytes ) - added by Jerome Etienne <jerome.etienne@…> 16 years ago.

Download all attachments as: .zip

Change History (6)

by Jerome Etienne <jerome.etienne@…>, 16 years ago

Attachment: patch_django added

comment:1 by Eric Holscher, 16 years ago

milestone: 1.0
Triage Stage: UnreviewedAccepted

comment:2 by James Bennett, 16 years ago

Does MySQLdb support this, and if so what's the oldest version that does support it?

comment:3 by James Bennett, 16 years ago

Triage Stage: AcceptedReady for checkin

nm, just checked on 1.2.1 and it works.

comment:4 by Brian Rosner, 16 years ago

Resolution: fixed
Status: newclosed

(In [8475]) Fixed #7536 -- Added NEWDECIMAL to introspection types in the mysql backend. Thanks Jerome Etienne for the patch.

comment:5 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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