如何从django模型创建双重和长文本字段
发布时间:2020-12-20 11:45:13 所属栏目:Python 来源:网络整理
导读:如何使用 django模型在 mysql中创建一个双字段.我遇到这个错误,以及如何使用django创建一个longtext数据类型 class Test(models.Model): maxcount = models.DoubleField(null=True) ## double DEFAULT NULL,cs = models.TextField()#longtext, 错误: maxcou
如何使用
django模型在
mysql中创建一个双字段.我遇到这个错误,以及如何使用django创建一个longtext数据类型
class Test(models.Model): maxcount = models.DoubleField(null=True) ## double DEFAULT NULL,cs = models.TextField()#longtext, 错误: maxcount = models.DoubleField(null=True) ##double DEFAULT NULL,AttributeError: 'module' object has no attribute 'DoubleField' 解决方法
https://docs.djangoproject.com/en/1.8/ref/models/fields/#bigintegerfield
https://docs.djangoproject.com/en/1.8/ref/models/fields/#decimalfield https://docs.djangoproject.com/en/dev/ref/models/fields/#floatfield 如果需要Integer和decimal字段,请使用big int. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |