gpt4 book ai didi

django - 如何为 Django 的 TextField 在 South 指定默认值?

转载 作者:行者123 更新时间:2023-12-02 05:34:13 26 4
gpt4 key购买 nike

我向模型添加了一个 TextField,该模型的相应表已在数据库中创建。当我向南跑时,我收到以下消息:

Since you are adding this field, you MUST specify a default value to use for existing rows. Would you like to: 1. Quit now, and add a default to the field in models.py 2. Specify a one-off value to use for existing columns now

我选择了选项 2) 并为其指定了默认字符串值。但无论我给出什么字符串值,它都只是响应“无效选择”。

我在为南部的 TextField 指定默认值时是否做错了什么?或者这是一个错误?

谢谢。

最佳答案

South 似乎唯一一次说“无效选择”是当它要求选择选项 1. 或 2. 并且您输入了无效数字时。

关于django - 如何为 Django 的 TextField 在 South 指定默认值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8044532/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com