What I generally do is use https://pypi.org/project/nameparser/

While Clive is correct, I haven’t seen name parser fail at breaking it apart 
correct so far.

        - Benjamin



> On Jul 8, 2020, at 6:43 PM, Clive Bruton <cl...@indx.co.uk> wrote:
> 
> 
> On 7 Jul 2020, at 22:58, Kai Kobschätzki wrote:
> 
>> I render one input field surname. And if the user writes one string in
>> the input field it should be saved to surname (so forename is None). If
>> the user writes two strings (separated through a white space) than the
>> first part should be saved to forename and the second one to surname
>> (and perhaps I want to make some string manipulation further).
> 
> This isn't a "safe" way of delineating forename/surname. It isn't that 
> uncommon for people to have unhyphenated compound surnames, eg:
> 
>    Bruce Smith Jones
> 
> To see the confusion this may cause:
> 
> https://en.wikipedia.org/wiki/Arthur_Conan_Doyle
> 
> It is better to ask for the forename input separately, or at least give the 
> user the option to override your decision.
> 
> 
> -- Clive
> 
> -- 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/E644135A-7C74-4689-B3CB-6AA03224AC84%40indx.co.uk.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2B6C4AC8-1AE2-459D-9ED1-B5F954E9BD60%40schollnick.net.

Reply via email to