django model CharField: max_length does not work?
问题 I'm trying to make a field with limited choices: Action_Types=( ('0','foo'), ('1','bar'), ) class Foo(models.Model): myAction=models.CharField(max_length=1,choices=Action_Types) def __unicode__(self): return '%d %s'%(self.pk,self.myAction) However, when I was trying to insert content violating the rules, it succeeded without any error or warning messages (with "manage.py shell"). It seems any text of any length can be put into this field. I'm using SQLite3 as the backend. Is it supposed to be