默认情况下,一个选择字段中的选项数是 4,有没有增加这个数字的选项?也许到 5 或 6?
编辑:
我的模型 -->
class Other(models.Model):
txt = models.CharField(choices=CHOICES) #CHOICES is a dynamically generated list of tuples from a database query
class Meta:
db_table = 'my_table'
ordering = ['txt']
class Main(models.Model):
#Other fields..
other = models.ManyToManyField(Other)
html -->
//I use the 'Main' model that is represented as 'form' in the html code
//....
{{ form.other.label }}<br>
{{ form.other }}
//rest of html....