using default as none in django mdoels

Solutions on MaxInterview for using default as none in django mdoels by the best coders in the world

showing results for - "using default as none in django mdoels"
Paulette
22 Jan 2016
1>>> type('')
2<class 'str'>
3>>> type(None)
4<class 'NoneType'>
5>>>
6
7Avoid using null on string-based fields such as CharField and TextField. 
8If a string-based field has null=True, that means it has two possible values forno data”: NULL, and the empty string. 
9In most cases, it’s redundant to have two possible values for “no data;” 
10the Django convention is to use the empty string, not NULL.
11One exception is when a CharField has both unique=True and blank=True set. 
12In this situation, null=True is required to avoid unique constraint violations when saving multiple objects with blank values.
13
similar questions
queries leading to this page
using default as none in django mdoels