Possible Duplicate:
Django models: default value for column
I have created a model field like this in models
profile_complete = models.BooleanField(default=False, db_index=True)
Now when I see the database table in mysql dbshell
it is showing me information for profile_complete like this
Field | Type | Null | Key | Default | Extra |
profile_complete | tinyint(1) | NO | MUL | NULL | |
I have set the Default as False for it then why it is showing NULL as default for it?
Your question is already answered.
When you assign a default value for a model field (which can even be a callable), this value is set by the Django ORM for every object in case another value is not provided while saving.
That means if you will insert some records manually, through the DB shell, this default value won’t be used.