From 2ae9035a3724f54c4ca0bc26c56fb0e7e2e1cbfa Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 9 Mar 2012 23:53:52 +0100 Subject: [PATCH] places too --- pandora/annotation/models.py | 2 +- pandora/annotation/tasks.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 6678e239d..69cc07898 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -130,7 +130,7 @@ class Annotation(models.Model): layer = self.get_layer() if self.value: self.value = utils.cleanup_value(self.value, layer['type']) - self.findvalue = ox.decodeHtml(ox.stripTags(self.value).strip()).replace('\n ', ' ') + self.findvalue = ox.decodeHtml(ox.stripTags(self.value).strip()).replace('\n', ' ') sortvalue = sort_string(self.findvalue) if sortvalue: self.sortvalue = sortvalue[:900] diff --git a/pandora/annotation/tasks.py b/pandora/annotation/tasks.py index d828d5ac2..4dc6ad190 100644 --- a/pandora/annotation/tasks.py +++ b/pandora/annotation/tasks.py @@ -25,9 +25,9 @@ def update_matching_events(id): names = {} for n in Event.objects.all().values('id', 'name', 'alternativeNames'): - names[n['id']] = [ox.decodeHtml(n) for n in [n['name']] + json.loads(n['alternativeNames'])] + names[n['id']] = [ox.decodeHtml(x) for x in [n['name']] + json.loads(n['alternativeNames'])] - value = a.findvalue.lower().replace('\n', ' ') + value = a.findvalue.lower() update = [] for i in names: for name in names[i]: @@ -54,8 +54,8 @@ def update_matching_places(id): names = {} for n in Place.objects.all().values('id', 'name', 'alternativeNames'): - names[n['id']] = [n['name']] + json.loads(n['alternativeNames']) - value = a.value.lower() + names[n['id']] = [ox.decodeHtml(x) for x in [n['name']] + json.loads(n['alternativeNames'])] + value = a.findvalue.lower() update = [] for i in names: for name in names[i]: