models.FloatFieldcreates a double in MySQL.Is it possible, and how to create a precision field float instead of double precision?
models.FloatField
The rationale is similar to what SmallIntegerField has.
There are several options for this, but I don’t understand why you want to.
FloatField
get_internal_type()
SinglePrecisionFloatField
creation.DatabaseCreation.data_types
, , . , db, db_type() django.
django, Field
class customFloatField(models.Field): def db_type(self,connection): return 'float'
number = customFloatField(null=True,blank=True)
, MySQL. , if .
https://docs.djangoproject.com/en/dev/howto/custom-model-fields/
Source: https://habr.com/ru/post/1777916/More articles:Using reflection to instantiate a class in a DLL - reflectionTSQL Recursive Update? - tsqlJQuery - backslash character - javascripthttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1777914/what-does-the-accept-method-of-astnode-do-and-how-does-it-use-the-astvisitor&usg=ALkJrhgEZn3_-IcP7mL5DCfyZvpbNURGuQHow to set current currency in paypal in magento? - magentoПоиск файла FASTA для мотива и возврата строки заголовка для каждой последовательности, содержащей мотив - perlBinding Buttons IsEnabled / Visibility Properties Using x: Name as parameter in method in code - c #Symfony - which version to start with - phpHow to make files with a specific extension automatically added to the commit? - mercurialAre ASP.net Content web forms available for the variables listed in the "Code Behind" section of the main page? - asp.netAll Articles