diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2006-02-18 23:04:09 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2006-02-18 23:04:09 +0000 |
| commit | 53ca15cd78cdcb881b31cc417f8709c10fafaadd (patch) | |
| tree | 6daa0c8cc85e2125f034fbc910fdd9b0f7db0a8c | |
| parent | cf528aa420344ceb6ed72f517002f0cf5fbd2111 (diff) | |
Fixed #1289 -- Improved 'inspectdb' to introspect decimal_places and max_digits for FloatFields. Thanks, gandalf@owca.info
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2356 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/management.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/django/core/management.py b/django/core/management.py index 5c5f067892..f4ef6cd954 100644 --- a/django/core/management.py +++ b/django/core/management.py @@ -633,6 +633,10 @@ def inspectdb(db_name): if field_type == 'CharField' and row[3]: extra_params['maxlength'] = row[3] + if field_type == 'FloatField': + extra_params['max_digits'] = row[4] + extra_params['decimal_places'] = row[5] + # Add primary_key and unique, if necessary. column_name = extra_params.get('db_column', att_name) if column_name in indexes: |
