title refinement
This commit is contained in:
parent
04acc3c6f3
commit
2692300f3b
5 changed files with 19 additions and 10 deletions
|
|
@ -15,9 +15,12 @@ import managers
|
|||
|
||||
|
||||
def get_name_sort(name):
|
||||
name = unicodedata.normalize('NFKD', name)
|
||||
person, created = Person.objects.get_or_create(name=name)
|
||||
sortname = unicodedata.normalize('NFKD', person.sortname)
|
||||
name = unicodedata.normalize('NFKD', name).strip()
|
||||
if name:
|
||||
person, created = Person.objects.get_or_create(name=name)
|
||||
sortname = unicodedata.normalize('NFKD', person.sortname)
|
||||
else:
|
||||
sortname = u''
|
||||
return sortname
|
||||
|
||||
class Person(models.Model):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue