stuck in implementing search in django
<p>I want to implement search in django. I don't use any search technique like solar etc. I am using simple filter query of django.
Now the problem is this: 
I have a model <strong><code>Product</code></strong>
with five field <code>name</code>, <code>cost</code>, <code>brand</code>, <code>expiry_date</code>, <code>weight</code>
I want to implement a advanced search feature with all fields,
by:</p>

<pre><code>name = request.GET.get('name')
</code></pre>

<p>I get a value on which basis I search all product.
What I want is that when <strong><code>name = None</code></strong>, it has to search for all names.
<strong>So problem is this: if values are not coming by user side, how can i search for all names?</strong></p>

<p>if you want when the name is None, you have to search all names in Product Model
try this logic</p>

<pre><code>if name == None:
    result = Product.objects.all()
else:
    result = Product.objects.filter(name = name)
</code></pre>

python django