From d1efe62ddbce912b084ee60f9656b36db09cfba2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 30 Oct 2011 01:15:44 +0200 Subject: [PATCH] sync facets if sort changed --- pandora/person/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandora/person/models.py b/pandora/person/models.py index ab696f54b..c1b7840db 100644 --- a/pandora/person/models.py +++ b/pandora/person/models.py @@ -10,6 +10,7 @@ from ox.django import fields import ox from item import utils +import item.models import managers @@ -50,6 +51,10 @@ class Person(models.Model): self.sortsortname = utils.sort_string(self.sortname) self.numberofnames = len(self.name.split(' ')) super(Person, self).save(*args, **kwargs) + item.models.Facet.objects.filter( + key__in=item.models.Item.person_keys, value=self.name + ).exclude(value_sort=self.sortname + ).update(value_sort=self.sortname) def get_or_create(model, name, imdbId=None): if imdbId: