mirror of
https://github.com/django/django.git
synced 2025-07-27 23:24:14 +00:00
Fixed #17796 -- Rolled back [17588] because the fix for the original relatively
corner case (boolean fields under MySQL spatial backend) had a wider scope with potentially unintended consequences affecting the main MySQL backend and the required changes wouldn't be appropiate at this point of the 1.4 development cycle. Refs #15169. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c471cfd674
commit
ae640e5ea0
8 changed files with 11 additions and 49 deletions
|
@ -5,7 +5,10 @@ class SQLCompiler(compiler.SQLCompiler):
|
|||
values = []
|
||||
index_extra_select = len(self.query.extra_select.keys())
|
||||
for value, field in map(None, row[index_extra_select:], fields):
|
||||
values.append(self.query.convert_values(value, field, connection=self.connection))
|
||||
if (field and field.get_internal_type() in ("BooleanField", "NullBooleanField") and
|
||||
value in (0, 1)):
|
||||
value = bool(value)
|
||||
values.append(value)
|
||||
return row[:index_extra_select] + tuple(values)
|
||||
|
||||
class SQLInsertCompiler(compiler.SQLInsertCompiler, SQLCompiler):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue