When we add a database field in django we generally write models.CharField(max_length=100, null=True, blank=True)
. 当咱们在Django中添加数据库字段时,一般会编写models.CharField(max_length=100, null=True, blank=True)
。 The same is done with ForeignKey
, DecimalField
etc. What is the basic difference in having 对ForeignKey
, DecimalField
等进行相同的操做。 数据库
null=True
only null=True
仅null=True
blank=True
only blank=True
仅blank=True
null=True
, blank=True
null=True
, blank=True
in respect to different ( CharField
, ForeignKey
, ManyToManyField
, DateTimeField
) fields. 关于不一样的字段( CharField
, ForeignKey
, ManyToManyField
, DateTimeField
)。 What are the advantages/disadvantages of using 1/2/3? 使用1/2/3有哪些优势/缺点? django