#17957: ORM do not respect null=False if default db engine
interprets_empty_strings_as_nulls
-------------------------------------+-------------------------------------
Reporter: bhuztez | Owner: nobody
Type: Bug | Status: reopened
Component: Database layer | Version: SVN
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by bhuztez):
* status: closed => reopened
* resolution: needsinfo =>
Comment:
> What do you mean when you say "default db engine".
{{{DATABASES['default']['ENGINE']}}}
> What did you really do? Change the DB backend used to the Oracle backend
or to the dummy backend?
> Why are you messing with the dummy backend and with the
interprets_empty_strings_as_nulls feature?
I was reading `django/db/models/fields/__init__.py`, found the following
lines very suspicious.
{{{#!python
# Oracle treats the empty string ('') as null, so coerce the null
# option whenever '' is a possible value.
if (self.empty_strings_allowed and
connection.features.interprets_empty_strings_as_nulls):
self.null = True
}}}
But I do not have oracle installed on my desktop. So I decide to change
dummy backend to test.
> Did you change the backend used in both default and other aliases?. If
not, in which of them?
No, just switch the default one.
> Does the fact that you are running sql sites with the --database=other
switch affect the outcome of the tests you are performing or can the
example be simplified even more by removing that noisy moving part?
I run the same command `python manage.py sql sites --database=other`
before and after the switch.
--
Ticket URL: <https://code.djangoproject.com/ticket/17957#comment:2>
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 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.