﻿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
20182	prepare_lookup_value should treat 0 as False for __isnull	benjie@…	nobody	"In contrib.admin.util, there is a prepare_lookup_value function

In this function, there is a clause

    if value.lower() in ('', 'false'):
            value = False

I think it should be

    if value.lower() in ('', 'false', '0'):
          value = False

Note that in admin already converts a limit_choices_to={'a__isnull': False} to a__isnull=0 when formatting a query string for lookup on the remote model. Therefore, clearly it should also handle isnull=0 correctly. Currently the lookup popup box on remote model uses __isnull=0 and does not actually filter.

See the following pull request

https://github.com/django/django/pull/982




"	Bug	new	contrib.admin	1.5	Normal				Unreviewed	1	0	0	0	1	0
