add sortvalue to annotations to get better sort by text results
This commit is contained in:
parent
a960a7bd18
commit
7eeb6dc107
4 changed files with 9 additions and 5 deletions
|
|
@ -48,7 +48,6 @@ class Person(models.Model):
|
|||
if not self.sortname:
|
||||
self.sortname = ox.get_sort_name(self.name)
|
||||
self.sortname = unicodedata.normalize('NFKD', self.sortname)
|
||||
self.sortname = self.sortname.replace(u'Æ', 'AE').replace(u'Ø', 'O').replace(u'Þ', 'P')
|
||||
self.sortsortname = utils.sort_string(self.sortname)
|
||||
self.numberofnames = len(self.name.split(' '))
|
||||
super(Person, self).save(*args, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue