阅读背景:

Django表单错误:选择一个有效的选项。……不是一个可以选择的选择

来源:互联网 

I am trying to create a dynamic choice field. I have a view that creates a list of tuples. The first value of the tuple is the primary key of the object ServiceWriter while the second value is the name of the ServiceWriter. The list then gets passed into the form class. When I make the selection and submit the page the form is decided to be not valid and the following form error is printed in the shell: "Select a valid choice. (First value of tuple. ie 1,2,3..) is not one of the available choices."I am trying to create a dynamic choice field. I




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: