Thanks..I'll search for that but i think its not related to the query, its
related to two search i have used in one post request

On Wed, Apr 3, 2019 at 5:57 PM Guru Murthy <gurumurthy2...@gmail.com> wrote:

> Hi abhineet baranwal,
> You have to use q(id__in=search) instead q(id__icontains=search) ..search
> more about how to use in query in django and 1 thing you are not getting
> correct post value of searc1
>
> On Wed, 3 Apr, 2019, 5:31 PM Abhineet Baranwal, <
> suabhineetbaran...@gmail.com> wrote:
>
>> Thanks for your efforts, But i didn't get it can you please elaborate
>> your answer?
>>
>> On Wed, Apr 3, 2019 at 5:16 PM Guru Murthy <gurumurthy2...@gmail.com>
>> wrote:
>>
>>> Hi Abhijeet baranwal,
>>>   I think you are adding contains is not correct query listing you have
>>> to use in query instead
>>>
>>>
>>> On Wed, 3 Apr, 2019, 5:02 PM Abhineet Baranwal, <
>>> suabhineetbaran...@gmail.com> wrote:
>>>
>>>>
>>>> *this is my views file which creates an error like
>>>> django.utils.datastructures.MultiValueDictKeyError: 'search1' . Can anyone
>>>> tell me where i go wrong?*
>>>>
>>>> *def viewstr(request):*
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> *    views = create_store.objects.all()    brn =
>>>> Prod_Brand.objects.all()    mi = ''    if request.method == 'POST':
>>>> # mi = ''        search1 = request.POST['search1']        if search1 == ''
>>>> :            pass        else:            mi =
>>>> create_store.objects.filter(Q(select_brand__Brand__icontains=search1))
>>>> if mi:                return
>>>> render(request,'viewstr.html',{'vi':mi,'brn':brn})        search =
>>>> request.POST['search']        if search == '' :            pass        else
>>>> :            mi =
>>>> create_store.objects.filter(Q(id__icontains=search))            if
>>>> mi:                return
>>>> render(request,'viewstr.html',{'vi':mi,'brn':brn})    return
>>>> render(request,'viewstr.html',{'viewstr':viewstr,'vi':mi,'brn':brn})*
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at https://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/cdafd13a-46b5-471d-a927-b3d5d8e58f5c%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/cdafd13a-46b5-471d-a927-b3d5d8e58f5c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMgkGLV-OzbGCnJZv-MoQz5GvjgetOjjZ-TVV5KLNQMezZC13g%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAMgkGLV-OzbGCnJZv-MoQz5GvjgetOjjZ-TVV5KLNQMezZC13g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAFOSuXL4i%3DqCWNWkRwm2MFfHgvD9jJueZd4uARFb6Rza%2BAy-JA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAFOSuXL4i%3DqCWNWkRwm2MFfHgvD9jJueZd4uARFb6Rza%2BAy-JA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMgkGLWeRc8DRMQxmtJ5hsb%2BWEvs1%3DQtCv4dO5v7d5_RJOwUGg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMgkGLWeRc8DRMQxmtJ5hsb%2BWEvs1%3DQtCv4dO5v7d5_RJOwUGg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFOSuXKwQ0%2B2JVFuT_uvx6_%2BFPxrJz0Lcyet2d%3DKLM%3DS2k2ZTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to