forked from 0x2620/pandora
sync facets if sort changed
This commit is contained in:
parent
de4540426c
commit
d1efe62ddb
1 changed files with 5 additions and 0 deletions
|
@ -10,6 +10,7 @@ from ox.django import fields
|
||||||
import ox
|
import ox
|
||||||
|
|
||||||
from item import utils
|
from item import utils
|
||||||
|
import item.models
|
||||||
|
|
||||||
import managers
|
import managers
|
||||||
|
|
||||||
|
@ -50,6 +51,10 @@ class Person(models.Model):
|
||||||
self.sortsortname = utils.sort_string(self.sortname)
|
self.sortsortname = utils.sort_string(self.sortname)
|
||||||
self.numberofnames = len(self.name.split(' '))
|
self.numberofnames = len(self.name.split(' '))
|
||||||
super(Person, self).save(*args, **kwargs)
|
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):
|
def get_or_create(model, name, imdbId=None):
|
||||||
if imdbId:
|
if imdbId:
|
||||||
|
|
Loading…
Reference in a new issue