On 11/08/2019 3:25 am, aman kumar wrote:
 hello...
While using field type null ...
what is difference between "Empty string" and Null=True i.e null ......value for "no data"  in string based field...........?

Empty string is ""
Django likes to convert str=None (ie no value) into an empty string depending on the RDBMS.

https://docs.djangoproject.com/en/2.1/ref/databases/#null-and-empty-strings
https://docs.djangoproject.com/en/2.1/ref/forms/fields/#django.forms.Field.required

From the latter link ...

"If a |Field| has |required=False| and you pass |clean()| an empty value, then |clean()| will return a /normalized/ empty value rather than raising |ValidationError|. For |CharField|, this will be an empty string. For other |Field| classes, it might be |None|. (This varies from field to field.)"

It looks like you might have used an existing thread to ask your question. It is always best to start a new thread when you have a new question.

Cheers

Mike


--
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 [email protected] <mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/83c3f78b-5a57-4638-a3bb-dae1c2fd1969%40googlegroups.com <https://groups.google.com/d/msgid/django-users/83c3f78b-5a57-4638-a3bb-dae1c2fd1969%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/705d19a2-cdcf-b759-e619-0c1a3ae18ef2%40dewhirst.com.au.

Reply via email to