#17564: django.db.models.Sum does not work on BooleanField -------------------------------------+------------------------------------- Reporter: dp_wiz | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: SVN (models, ORM) | Resolution: Severity: Normal | Triage Stage: Accepted Keywords: postgresql | Needs documentation: 0 Has patch: 0 | Patch needs improvement: 0 Needs tests: 0 | UI/UX: 0 Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by anonymous): Can you please explain how to do it through django without using the patch? Replying to [comment:2 akaariai]: > The problem here is that PostgreSQL would need a type cast to int. So, the SQL should look like SUM("some_boolean_field"::int) for the SUM to work. However I am not sure if doing this in Django is a good idea, mainly because this would complicate the code somewhat, and something like #11305 would solve the issue for the user by allowing generation of SQL like in the Mozilla bug report. > > I am leaving this ticket still open, although I would like to close this as wontfix for the reasons mentioned above. Could this be marked duplicate (or "related to") to #11305? -- Ticket URL: <https://code.djangoproject.com/ticket/17564#comment:4> 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 this group at http://groups.google.com/group/django-updates?hl=en.