Django MySQL超出第1行“telephone”列的范围值

时间:2021-06-06 16:41:38

I looked everywhere to find a solution to this problem where I cannot type an integer of certain size. In other posts, people suggested that I define a custom BigInteger class but that was not very helpful. Using the default BigInteger class from models doesn't seem to fix the problem either. It still gives me the error, "Out of range value for column 'telephone' at row 1" Does anyone have any ideas how to fix it??

我到处寻找这个问题的解决方案,在这个问题中,我不能键入一个特定大小的整数。在其他文章中,人们建议我定义一个自定义的BigInteger类,但这并不是很有帮助。使用模型中的默认BigInteger类似乎也不能解决问题。它还是给了我一个错误,“第一行的‘电话’超出了范围”,有人知道怎么修正吗?

Thanks!

谢谢!

1 个解决方案

#1


2  

I usually save phone numbers as a string (CharField). If you later use international phone numbers, a number such as "+15554441234" should be valid. That's why I think strings are a better choice.

我通常将电话号码保存为字符串(CharField)。如果您稍后使用国际电话号码,则“+15554441234”等号码应该是有效的。这就是为什么我认为字符串是更好的选择。

#1


2  

I usually save phone numbers as a string (CharField). If you later use international phone numbers, a number such as "+15554441234" should be valid. That's why I think strings are a better choice.

我通常将电话号码保存为字符串(CharField)。如果您稍后使用国际电话号码,则“+15554441234”等号码应该是有效的。这就是为什么我认为字符串是更好的选择。