When using Q objects in django queryset for OR condition error occured
<p>I want to use filter with OR condition in django.
For this i want to use Q objects.
My code is this</p>

<pre><code>def product(request):
    try:

        proTitle = request.GET.get('title')
        ProDescription = request.GET.get('description')


    except:
        pass


    list0 = []
    result = Product.objects.filter(Q(title__contains=proTitle ) | Q(description__contains=ProDescription ) )

    for res in result:

        list0.append(res.project_id)
    data ={'title result':list0}
    return HttpResponse(json.dumps(data))



return HttpResponse(json.dumps(data), content_type='application/json')
</code></pre>

<p>When pass all value that is <code>proTitle,ProDescription
it working fine.
If any value is going to none it encounter a error</code>Cannot use None as a query value`
Why this error occured when i am using OR operator into my queryset</p>

<p>I am also try this </p>

<p><code>result = Project.objects.filter(title__contains=proTitle) | Project.objects.filter(description__contains=ProDescription )</code></p>

<p>but same error occured
I am unable to understand actually what is the problem</p>