It won't work because there's no database column that corresponds to
the full name.

A simple but limited alternative would be to split the string on " "
and use the result as first_name and last_name, but you would probably
want to take into account first_names and/or last_names with
legitimate spaces in them (e.g. "Mary Ann" or "van der Waal", perhaps
by compiling a list of each possible configuration and using that to
filter on with first_name__in and last_name__in.


On Jul 22, 2:06 pm, Matias <matiassu...@gmail.com> wrote:
> Hi,
>
> What is the recommended way to get all the users whose full_name matches
> a given string?
>
> I need to do something like:
>
> User.objects.filter(get_full_name="John Test")
>
> But that doesn't seem to work.
>
> Is list comprehensions the only way to go?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to