报错:1不在可用的选项中

解决办法:

对CharField的choices的选项,

gender = models.CharField(max_length=, choices=((, "Male"),(, "Female")), default="")

改为:

gender = models.CharField(max_length=10, choices=(("M", "Male"),("F", "Female")), default="")

  

05-11 22:53