forked from 0x2620/pandora
normalize
This commit is contained in:
parent
bfb7bd88ba
commit
b321656bff
3 changed files with 3 additions and 1 deletions
2
README
2
README
|
@ -33,7 +33,7 @@ you need python, bazaar, pip and virtualenv and several other python modules:
|
||||||
and run ./manage.py syncdb to populate the database
|
and run ./manage.py syncdb to populate the database
|
||||||
you might want to load example configurations from fixutes.
|
you might want to load example configurations from fixutes.
|
||||||
|
|
||||||
createdb --locale=C --encoding=UTF8 pandora
|
createdb -T template0 --locale=C --encoding=UTF8 -O pandora pandora
|
||||||
|
|
||||||
* RabbitMQ
|
* RabbitMQ
|
||||||
For background tasks we use RabbitMQ, to install rabbitmq:
|
For background tasks we use RabbitMQ, to install rabbitmq:
|
||||||
|
|
|
@ -15,6 +15,7 @@ import managers
|
||||||
|
|
||||||
|
|
||||||
def get_name_sort(name):
|
def get_name_sort(name):
|
||||||
|
name = unicodedata.normalize('NFKD', name)
|
||||||
person, created = Person.objects.get_or_create(name=name)
|
person, created = Person.objects.get_or_create(name=name)
|
||||||
sortname = unicodedata.normalize('NFKD', person.sortname)
|
sortname = unicodedata.normalize('NFKD', person.sortname)
|
||||||
return sortname
|
return sortname
|
||||||
|
|
|
@ -13,6 +13,7 @@ from item import utils
|
||||||
import managers
|
import managers
|
||||||
|
|
||||||
def get_title_sort(title):
|
def get_title_sort(title):
|
||||||
|
title = unicodedata.normalize('NFKD', title)
|
||||||
title, created = Title.objects.get_or_create(title=title)
|
title, created = Title.objects.get_or_create(title=title)
|
||||||
sorttitle = unicodedata.normalize('NFKD', title.sorttitle)
|
sorttitle = unicodedata.normalize('NFKD', title.sorttitle)
|
||||||
return sorttitle
|
return sorttitle
|
||||||
|
|
Loading…
Reference in a new issue