﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
374	[patch] Filtering BooleanField does not work with SQLite 	davidschein@…	Adrian Holovaty	"When Django wants to filter on a bool, it passes the parameter value as 'True' or 'False', whereas SQLite expects a 1/0 or '1'/'0' or even a proper Python True/False.  But the string containing 'True'/'False' is lost on it.  I am not sure where to address this in the code.  The sqlite adapted does not know about models, so main might be the best place for logic to look for backend mappings (which need to be added obviously.)  Trivially, the following hack/patch gets it working for sqlite.

{{{
Index: main.py

===================================================================

--- main.py	(revision 537)

+++ main.py	(working copy)

@@ -251,7 +251,7 @@

                 lookup_val = request.GET.get(lookup_kwarg, None)
                 lookup_val2 = request.GET.get(lookup_kwarg2, None)
                 filter_template.append('<h3>By %s:</h3><ul>\n' % f.verbose_name)
-                for k, v in (('All', None), ('Yes', 'True'), ('No', 'False')):
+                for k, v in (('All', None), ('Yes', '1'), ('No', '0')):
                     filter_template.append('<li%s><a href=""%s"">%s</a></li>\n' % \
                         (((lookup_val == v and not lookup_val2) and ' class=""selected""' or ''),
                         get_query_string(params, {lookup_kwarg: v}, [lookup_kwarg2]), k))
}}}"	defect	closed	contrib.admin		major	fixed	sqlite, filters, booleanfield		Unreviewed	1	0	0	0	0	0
