开发者

In Django, why does this error say that my column can't be null?

picture_url = models.CharField(max_length=20开发者_开发技巧00)


You'll need to add null=True if the column can be null:

picture_url = models.CharField(max_length=2000, null=True)


By default fields have null set to False try this

picture_url = models.CharField(max_length=2000, blank=True)

http://docs.djangoproject.com/en/1.1/ref/models/fields/#null

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜