Thanks sacrac and Lucas.

On Friday, April 11, 2014 4:26:23 AM UTC+10, Lucas Klassmann wrote:
>
> Hi,
>
> If you want exact match:
>
> user_list.filter(user__name__iexact=user.name)
>
>
> Or containment test:
> user_list.filter(user__name__icontains=user.name)
>
>
> Note that "i" on start is for case-insensitive filtering.
>
> Look here for more information:
> https://docs.djangoproject.com/en/dev/topics/db/queries/
>
>
> Cheers
>
>
> On Thu, Apr 10, 2014 at 2:38 PM, carlos <croch...@gmail.com 
> <javascript:>>wrote:
>
>> hi, maybe you filter you queryset
>> user_list = Model.objects.filter(user__name=user.name
>> ).filter(other__field=user.email)
>>
>> Cheers
>>
>>
>> On Thu, Apr 10, 2014 at 9:44 AM, nobody <jupit...@gmail.com <javascript:>
>> > wrote:
>>
>>> Hi,
>>>
>>> How can I filter an item from the queryset object list if the name is 
>>> matching? The following won't work.
>>>
>>> user_list.filter(user__name=user.name)
>>>
>>> Thank you.
>>>
>>>
>>>  -- 
>>> 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...@googlegroups.com <javascript:>.
>>> To post to this group, send email to django...@googlegroups.com<javascript:>
>>> .
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/dd1f2a56-1ee7-4dd5-a513-12ef1ef5e83b%40googlegroups.com<https://groups.google.com/d/msgid/django-users/dd1f2a56-1ee7-4dd5-a513-12ef1ef5e83b%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...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAM-7rO2SDDC%2ByLgdx_Jb%3D021gsonaE9MYn8ZcpTgVEqYv_PoiQ%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAM-7rO2SDDC%2ByLgdx_Jb%3D021gsonaE9MYn8ZcpTgVEqYv_PoiQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Lucas Klassmann
> Desenvolvedor de Software
>
> Email: lucaskl...@gmail.com <javascript:>
> Web site: http://www.lucasklassmann.com
>  

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2fc0eba8-ab5e-411f-bd51-96220bd94ac3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to