forked from 0x2620/pandora
only store one item/key/value facet, remove facets with other case
This commit is contained in:
parent
69254bbe48
commit
aafac3c1d8
1 changed files with 1 additions and 0 deletions
|
@ -1080,6 +1080,7 @@ class Item(models.Model):
|
||||||
sortvalue = utils.sort_string(sortvalue).lower()[:900]
|
sortvalue = utils.sort_string(sortvalue).lower()[:900]
|
||||||
f, created = Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue)
|
f, created = Facet.objects.get_or_create(item=self, key=key, value=value, sortvalue=sortvalue)
|
||||||
if created:
|
if created:
|
||||||
|
Facet.objects.filter(item=self, key=key, value__iexact=value).exclude(value=value).delete()
|
||||||
Facet.objects.filter(key=key, value__iexact=value).exclude(value=value).update(value=value)
|
Facet.objects.filter(key=key, value__iexact=value).exclude(value=value).update(value=value)
|
||||||
saved_values.append(value.lower())
|
saved_values.append(value.lower())
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue