On Wed, Apr 07, 2021 at 03:25:53PM +0100, Roger Gammans wrote: > This is mostly (form the Django perspective) and issue with CharFields, > because a CharField can store None or ''. For values of '' > in CharField, IIRC, django will convert them to null, with null=True, > blank=True. But not with blank=True,null=False.See also : > https://docs.djangoproject.com/en/3.1/ref/models/fields/#null
I read the documentation a bit differently. My interpretation is that CharField(null=True) means that both ''(empty string) and None(null) are valid values. But no implicit conversion from '' to None takes place. CharField(null=False) means that None(null) isn't a valid value and that only ''(empty string) is permitted. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20210408213628.GL15054%40fattuba.com.