django xadmin 1不在可用的选项中
报错:1不在可用的选项中
解决办法:
对CharField的choices的选项,
gender = models.CharField(max_length=10, choices=((1, "Male"),(2, "Female")), default="1")
改为:
gender = models.CharField(max_length=10, choices=(("M", "Male"),("F", "Female")), default="1")