From 0b8b04234a0fccaf2f81d1b8587bda7198be123f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 11 Oct 2011 16:30:10 +0200 Subject: [PATCH] use get_sort_name/get_sort_title --- pandora/archive/models.py | 3 +-- pandora/person/models.py | 2 +- pandora/title/models.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 83dc6335..9c03e554 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -14,7 +14,6 @@ from django.db.models.signals import pre_delete from ox.django import fields import ox -from ox.normalize import canonicalTitle import chardet from item import utils @@ -79,7 +78,7 @@ class File(models.Model): def set_state(self): self.name = self.get_name() self.folder = self.get_folder() - self.sort_name = utils.sort_string(canonicalTitle(self.name)) + self.sort_name = utils.sort_string(ox.get_sort_title(self.name)) if not os.path.splitext(self.name)[-1] in ( '.srt', '.rar', '.sub', '.idx', '.txt', '.jpg', '.png', '.nfo') \ diff --git a/pandora/person/models.py b/pandora/person/models.py index 8a5cf554..226c132a 100644 --- a/pandora/person/models.py +++ b/pandora/person/models.py @@ -34,7 +34,7 @@ class Person(models.Model): def save(self, *args, **kwargs): if not self.name_sort: - self.name_sort = ox.normalize.canonicalName(self.name) + self.name_sort = ox.get_sort_name(self.name) self.name_sort = unicodedata.normalize('NFKD', self.name_sort) self.numberofnames = len(self.name.split(' ')) super(Person, self).save(*args, **kwargs) diff --git a/pandora/title/models.py b/pandora/title/models.py index 3c06682c..4b308326 100644 --- a/pandora/title/models.py +++ b/pandora/title/models.py @@ -28,7 +28,7 @@ class Title(models.Model): def save(self, *args, **kwargs): if not self.title_sort: - self.title_sort = ox.normalize.canonicalTitle(self.title) + self.title_sort = ox.get_sort_title(self.title) self.title_sort = unicodedata.normalize('NFKD', self.title_sort) super(Title, self).save(*args, **kwargs)