* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by anonymous):
I just spent a ton of time debugging to figure out what this bug is. It
causes ModelForms to have checkboxes that are all checked.
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:7>
* cc: benjaoming@… (added)
Comment:
*bump* there is a patch for this! It even contains a very neat set of
tests. Can it be merged and the bug closed? :)
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:8>
* version: 1.2 => 1.4
Comment:
In my opinion this is a fairly significant issue. I spent all morning
trying to figure out why a ModelForm (which was working perfectly locally
on SQLite) had broken checkbox fields when deployed with a mysql backend.
{{{
parent = ParentModel.objects.select_related('child').get(pk=id)
# BooleanFields won't work with this form if using MySQL because their
values are rendered as ints due to select_related()
child_form = ChildModelForm(instance=parent.child)
}}}
If there's no easy fix to this in Django itself I think there should at
least be a warning in the documentation letting users know of this issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:9>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"f3a2bcdee906f7ca1434b6275fdc09b3a454cf46"]:
{{{
#!CommitTicketReference repository=""
revision="f3a2bcdee906f7ca1434b6275fdc09b3a454cf46"
Fixed #15040 - Boolean fields return 0 and 1 when loaded through
select_related
Thanks to homm for the report and ramiro for the patch.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:10>
Comment (by Luke Plant <L.Plant.98@…>):
In [changeset:"142f69eb8c79ea5a54799354231b219f7c53b1cc"]:
{{{
#!CommitTicketReference repository=""
revision="142f69eb8c79ea5a54799354231b219f7c53b1cc"
[1.5.x] Fixed #15040 - Boolean fields return 0 and 1 when loaded through
select_related
Thanks to homm for the report and ramiro for the patch.
Backport of f3a2bcdee906f7ca1434b6275fdc09b3a454cf46 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:11>
* status: closed => new
* resolution: fixed =>
Comment:
I am having this problem in 1.5.1 -- 0 when using select related, but
False when not. I am using mysql.
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:12>
Comment (by anonymous):
The problem only occurs when using .defer()
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:13>
* status: new => closed
* resolution: => fixed
Comment:
@anonymous, please open a new ticket with a test case if you can reproduce
the issue on master. I tried the attached test based on your vague
description but it passes on master and 1.5.x.
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:14>
Comment (by akaariai):
I am pretty sure this one was fixed in #21203 and #21126, both of which
got backpatched to 1.5.
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:15>
Comment (by kylegibson):
I apologise if this isn't the proper place for this comment, but what
would it take to get this fix backpatched to 1.4?
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:16>
Comment (by carljm):
Replying to [comment:16 kylegibson]:
> I apologise if this isn't the proper place for this comment, but what
would it take to get this fix backpatched to 1.4?
I'm afraid it won't be. 1.4 is in security-fix-only mode.
--
Ticket URL: <https://code.djangoproject.com/ticket/15040#comment:17>