When we add a model field in Django we generally write:
models.CharField(max_length=100, null=True, blank=True)
The same is done with ForeignKey
, DecimalField
etc. What is the basic difference between:
null=True
onlyblank=True
onlynull=True
and blank=True
in respect to different (CharField
, ForeignKey
, ManyToManyField
, DateTimeField
) fields? What are the advantages/disadvantages of using option 1, 2, or 3?