views:

82

answers:

2

Some model fields such as DateTimeField require null=True option when blank=True option is set.

I'd like to know which fields require that (maybe dependent on backend DBMS), and there is any way to do this automatically.

+1  A: 

null=True is used to tell that in DB value can be NULL blank=True is only for django , so django doesn't raise error if field is blank e.g. in admin interface so blank=True has nothing to do with DB NULL requirement will vary from DB to DB, and it is upto you to decide if you want some column NULL or not

Anurag Uniyal
+2  A: 

This post should help to understand the difference on blank and null in Django

Hannson
Thanks for introducing that post. Well, I already knew the difference, but I think it is more natural to have automatic null=True for non-string columns with blank=True without default value.
Achimnol