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.

  1. change in database, won't work when recreating tables django won't manual cast if database changes, results.
  2. create custom fieldtype (i.e. inherit floatfield , change get_internal_type() returns singleprecisionfloatfield. after need create own database backend , add custom type creation.databasecreation.data_types (source: http://code.djangoproject.com/browser/django/trunk/django/db/backends/mysql/creation.py)
  3. change every floatfield single precision. above have create own database backend and/or change floatfield implementation in current one.

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -