﻿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
23572	Exception on Custom Lookups when right value is None.	maherma-adg	nobody	"For my current project I need generate a complex queryset filter and I decide implement as custom lookup.

I got the [https://docs.djangoproject.com/en/1.7/howto/custom-lookups/, example] as base to create custom lookup, but during test, this expresion:

data = Rsce.filter(duration{{{__}}}ne = None)

throw an exception. Any other expresion run smoothly.

Looking into code exception are thrown in this piece of code:


        if value is None:
            if lookups[-1] not in ('exact', 'iexact'):
                raise ValueError(""Cannot use None as a query value"")

IMHO the check in lookups must be avoided on custom lookups, allowing them to manage None values by themselves.

"	Bug	new	Database layer (models, ORM)	1.7	Normal		custom lookup, db		Unreviewed	0	0	0	0	0	0
