Django: How to use float precision instead of double precision in MySQL -
models.floatfield
creates double in mysql.
possible, , how, create float precision field instead of double precision?
the justification similar of having smallintegerfield.
there few options this, don't understand why want to.
- change in database, won't work when recreating tables django won't manual cast if database changes, results.
- create custom fieldtype (i.e. inherit
floatfield
, changeget_internal_type()
returnssingleprecisionfloatfield
. after need create own database backend , add custom typecreation.databasecreation.data_types
(source: http://code.djangoproject.com/browser/django/trunk/django/db/backends/mysql/creation.py) - change every
floatfield
single precision. above have create own database backend and/or changefloatfield
implementation in current one.
Comments
Post a Comment