KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
When defining fields in a django model, there are two ways to say that the field is allowed to be empty. null means it can be empty in the database, and blank says the field can be empty in a form. Why are these distinct? Every time I set one but not the other something goes wrong. Allowing them to be different seems to be to just inviting problems of the form allowing you to create objects the database won't accept. In other words, when would you ever use null=True,blank=False or null=False,blank=True in a django model?
Tags (comma-separated)
Save Edits
Cancel