#9590: CharField and TextField with blank=True, null=True saves u'' instead of
null
---------------------------------------------------+------------------------
Reporter: romke | Owner: nobody
Status: reopened | Milestone:
Component: Database layer (models, ORM) | Version: 1.0
Resolution: | Keywords: charfield,
textfield, null
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 1 |
---------------------------------------------------+------------------------
Changes (by [email protected]):
* status: closed => reopened
* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* resolution: wontfix =>
Comment:
The behavior is contrary to documentation.[[BR]]
When a field has null=True, django should store a NULL value, as
documented.[[BR]]
Documentation says "Avoid using null on string-based fields such as
CharField and TextField unless you have an excellent reason." When you
have a legacy database, you may be in a situation when you don't have the
choice. This is my case. Actually I even have a database integrity check
field<>''![[BR]]
[[BR]]
If you really really don't want to support null=True for these kind of
fields, you should fix the documentation and issue an error when a
null=True is found in a CharField.
--
Ticket URL: <http://code.djangoproject.com/ticket/9590#comment:4>
Django <http://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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.