#15040: Boolean fields return 0 and 1 when loaded through select_related -------------------------------------+------------------------------------- Reporter: homm | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: 1.4 (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: | Needs documentation: 0 Has patch: 1 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+------------------------------------- Changes (by anonymous):
* 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> 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 django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.