django 公布信息时提示:Out of range value for column 'phone_dh' at row 1


models.py里这样定义的:

phone_dh = models.integerFIele(blank=True, null=True) 

发布信息的:如果电话是11位的。就提示:
Warning at /post/
Out of range value for column 'phonedh' at row 1 

我改了my.cnf  
添加了:sql-mode="NO
AUTOCREATEUSER,NOENGINESUBSTITUTION" 

还是不起作用。

还要改哪里? 

我不想改数据库了。还要重新syncdb。。。。。。。有别的解决办法不? 

python django 程序开发

youxc 11 years, 2 months ago

需要修改你的数据库的表配置


integer的配置 


必须要BIGINT才能10位以上,并且如果你的电话号码前面是0开头的,存储了后也会被去掉的


你保存电话号码,为什么不修改为其他格式呢?

蹲在厕所数阿冀 answered 11 years, 2 months ago

Your Answer