forked from 0x2620/pandora
compute proper facet sort value
This commit is contained in:
parent
8d5dfd7413
commit
0719735feb
1 changed files with 2 additions and 2 deletions
|
@ -816,7 +816,7 @@ class Item(models.Model):
|
||||||
Facet.objects.filter(item=self, key=key, value__in=removed_values).delete()
|
Facet.objects.filter(item=self, key=key, value__in=removed_values).delete()
|
||||||
for value in current_values:
|
for value in current_values:
|
||||||
if value not in saved_values:
|
if value not in saved_values:
|
||||||
sortvalue = value.lower()[:900]
|
sortvalue = utils.sort_string(value).lower()[:900]
|
||||||
Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue)
|
Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue)
|
||||||
|
|
||||||
def update_layer_facets(self):
|
def update_layer_facets(self):
|
||||||
|
@ -864,7 +864,7 @@ class Item(models.Model):
|
||||||
sortvalue = value
|
sortvalue = value
|
||||||
if key in self.person_keys + ['name']:
|
if key in self.person_keys + ['name']:
|
||||||
sortvalue = get_name_sort(value)
|
sortvalue = get_name_sort(value)
|
||||||
sortvalue = sortvalue.lower()[:900]
|
sortvalue = utils.sort_string(value).lower()[:900]
|
||||||
Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue)
|
Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue)
|
||||||
self.update_layer_facets()
|
self.update_layer_facets()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue