lower case sort names
This commit is contained in:
parent
ee5ca8a54e
commit
1d6f64eed9
1 changed files with 5 additions and 4 deletions
|
@ -22,7 +22,7 @@ def get_name_sort(name, sortname=None):
|
||||||
if sortname:
|
if sortname:
|
||||||
person.sortname = sortname
|
person.sortname = sortname
|
||||||
person.save()
|
person.save()
|
||||||
sortname = unicodedata.normalize('NFKD', person.sortname)
|
sortname = unicodedata.normalize('NFKD', person.sortname).lower()
|
||||||
else:
|
else:
|
||||||
sortname = u''
|
sortname = u''
|
||||||
return sortname
|
return sortname
|
||||||
|
@ -50,18 +50,19 @@ class Person(models.Model):
|
||||||
if not self.sortname:
|
if not self.sortname:
|
||||||
self.sortname = ox.get_sort_name(self.name)
|
self.sortname = ox.get_sort_name(self.name)
|
||||||
self.sortname = unicodedata.normalize('NFKD', self.sortname)
|
self.sortname = unicodedata.normalize('NFKD', self.sortname)
|
||||||
self.sortsortname = utils.sort_string(self.sortname)
|
self.sortsortname = utils.sort_string(self.sortname).lower()
|
||||||
self.numberofnames = len(self.name.split(' '))
|
self.numberofnames = len(self.name.split(' '))
|
||||||
super(Person, self).save(*args, **kwargs)
|
super(Person, self).save(*args, **kwargs)
|
||||||
|
|
||||||
def update_itemsort(self):
|
def update_itemsort(self):
|
||||||
|
sortname = self.sortname.lower()
|
||||||
item.models.Facet.objects.filter(
|
item.models.Facet.objects.filter(
|
||||||
key__in=item.models.Item.person_keys + ['name'],
|
key__in=item.models.Item.person_keys + ['name'],
|
||||||
value=self.name
|
value=self.name
|
||||||
).exclude(
|
).exclude(
|
||||||
sortvalue=self.sortname
|
sortvalue=sortname
|
||||||
).update(
|
).update(
|
||||||
sortvalue=self.sortname
|
sortvalue=sortname
|
||||||
)
|
)
|
||||||
for i in item.models.Item.objects.filter(facets__in=item.models.Facet.objects.filter(
|
for i in item.models.Item.objects.filter(facets__in=item.models.Facet.objects.filter(
|
||||||
key__in=item.models.Item.person_keys + ['name'],
|
key__in=item.models.Item.person_keys + ['name'],
|
||||||
|
|
Loading…
Reference in a new issue