Opened 8 years ago

Closed 8 years ago

#27481 closed Cleanup/optimization (fixed)

boolean annotation returns integer on SQLite

Reported by: Sergey Fedoseev Owned by: Sergey Fedoseev
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In [1]: from django.db.models import Value, BooleanField

In [2]: from test_app.models import City

In [3]: City.objects.annotate(bool=Value(True, output_field=BooleanField())).values('bool')
Out[3]: <QuerySet [{'bool': 1}]>

Change History (4)

comment:1 by Sergey Fedoseev, 8 years ago

Owner: changed from nobody to Sergey Fedoseev
Status: newassigned

comment:2 by Sergey Fedoseev, 8 years ago

Has patch: set

comment:3 by Simon Charette, 8 years ago

Triage Stage: UnreviewedReady for checkin

comment:4 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In c7bfcd2f:

Fixed #27481 -- Made SQLite return annotated boolean values as boolean, not integer.

Thanks Simon Charette for review.

Note: See TracTickets for help on using tickets.
Back to Top