#24662: Sum() returns True/False when used with BooleanField & MySQL -------------------------------------+------------------------------------- Reporter: chriskief | Owner: marco- | santamaria Type: Bug | Status: assigned Component: Database layer | Version: 1.8 (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by akaariai): I'm not sure if this is actually worth doing. It would make Sum(bool_field) work like sum(bool_values) works in Python, and it wouldn't take that much code to do. On the other hand, there is something to be said for doing the Count explicitly. We should also solve what to do in 1.8. Should 1.8 work like 1.7? We could also disallow Sum(bool_field), or perhaps we want to push the above idea to 1.8, too? My initial feeling is that we should try what the solution actually looks like. The actual code portion of the changes might be surprisingly small. -- Ticket URL: <https://code.djangoproject.com/ticket/24662#comment:10> 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 unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.7214a94080943d94e857d6a754165e2f%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.