Opened 17 years ago
Closed 17 years ago
#1289 closed enhancement (fixed)
Inspectdb improvement of mysql extra_params for FloatFields and IntegerFields
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Management commands) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When inspectdb is used with mysql it can also figure out the number of decimal places for FloatFields and integer places for IntegerFields.
the addition to inspectdb in manager.py is:
if field_type == 'FloatField': extra_params['decimal_places'] = row[5] if field_type =='IntegerField': extra_params['max_digits'] = row[3]
I was not able to figure out how to get max_digits for FloatFields, suggestions welcome.
Change History (2)
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
Ups, I was a bit hasty. IntegerField does not support max_digits even though you can limit this in MySql.
So the correct addition would be: