layer facets too

This commit is contained in:
j 2012-04-24 19:13:44 +02:00
parent 079b0051c0
commit 1c80fb1f08

View file

@ -809,6 +809,7 @@ class Item(models.Model):
def update_layer_facet(self, key): def update_layer_facet(self, key):
current_values = [a['value'] current_values = [a['value']
for a in self.annotations.filter(layer=key).distinct().values('value')] for a in self.annotations.filter(layer=key).distinct().values('value')]
current_values = [ox.decodeHtml(v) for v in current_values]
saved_values = [i.value for i in Facet.objects.filter(item=self, key=key)] saved_values = [i.value for i in Facet.objects.filter(item=self, key=key)]
removed_values = filter(lambda i: i not in current_values, saved_values) removed_values = filter(lambda i: i not in current_values, saved_values)
if removed_values: if removed_values: