开发者

Django: How can I initialise a Charfield when using Add in an admin form?

I have a Charfield 'status' [with choices = (('A', 'aaa'), ('B', 'bbb'), ('C', ccc开发者_JAVA技巧'),)]

Can I initialise the field in the standard admin form to one of the choices? A drop down appears but no choice is selected by default.


Are you using the default option on the field?

CharField(default='A', choices=(...))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜