#4136: CharField(null=True, blank=True, unique=True)
-------------------------------------+-------------------------------------
Reporter: David Cramer | Owner:
<dcramer@…> | aashu_dwivedi
Type: Bug | Status: assigned
Component: Forms | Version: 1.3-rc
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by collinanderson):
* cc: cmawebsite@… (added)
Comment:
Seems to this actually applies to any fields that allow empty strings.
It's either the form or the model's responsibility to automatically
translate the blank strings into None in this case.
I usually work around the problem by putting this in my model's `save()`
method:
`self.myfield = self.myfield or None`
--
Ticket URL: <https://code.djangoproject.com/ticket/4136#comment:33>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/090.d1ed2ceef147c6bf646ecb7adee755dd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.