Django model blank=False does not work?

前端 未结 2 920
青春惊慌失措
青春惊慌失措 2020-12-18 22:40

I have the following model in Django 1.5:

class Person(models.Model):
    name = models.CharField(max_length=50)

Note that according to htt

2条回答
  •  感动是毒
    2020-12-18 23:17

    Django creates your user with an empty string. You can actually run Person.objects.all() and it will give you a list, if you save that to a variable called user_list and do something like user_list[0], it will return a user object with an empty string. I do not know how or why it does this.

提交回复
热议问题