summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/creation.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-21 01:29:58 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-05-21 01:29:58 +0000
commit92c35a0617836b09aef3b6909579ee368004969b (patch)
treecd5a12f945bf105a53a0346f84c7d5ca6fc7f11f /django/db/backends/mysql/creation.py
parent03966f077b8f87d6a59366dedc80fcf1f935e2d3 (diff)
downloaddjango-92c35a0617836b09aef3b6909579ee368004969b.tar.gz
Fixed #2365, #3324 -- Renamed FloatField to DecimalField and changed the code
to return Decimal instances in Python for this field. Backwards incompatible change. Added a real FloatField (stores floats in the database) and support for FloatField and DecimalField in newforms (analogous to IntegerField). Included decimal.py module (as django.utils._decimal) from Python 2.4. This is license compatible with Django and included for Python 2.3 compatibility only. Large portions of this work are based on patches from Andy Durdin and Jorge Gajon. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5302 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/mysql/creation.py')
-rw-r--r--django/db/backends/mysql/creation.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/mysql/creation.py b/django/db/backends/mysql/creation.py
index 22ed901653..1b23fbff6e 100644
--- a/django/db/backends/mysql/creation.py
+++ b/django/db/backends/mysql/creation.py
@@ -9,9 +9,10 @@ DATA_TYPES = {
'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
'DateField': 'date',
'DateTimeField': 'datetime',
+ 'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)',
'FileField': 'varchar(100)',
'FilePathField': 'varchar(100)',
- 'FloatField': 'numeric(%(max_digits)s, %(decimal_places)s)',
+ 'FloatField': 'double precision',
'ImageField': 'varchar(100)',
'IntegerField': 'integer',
'IPAddressField': 'char(15)',