From b019cda0045d07dabdf74d526385aec56bb544c0 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 10 Oct 2011 15:21:52 +0200 Subject: [PATCH 1/2] name_sort is not unique --- pandora/event/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/event/models.py b/pandora/event/models.py index 01df8736d..29b58ea51 100644 --- a/pandora/event/models.py +++ b/pandora/event/models.py @@ -29,7 +29,7 @@ class Event(models.Model): user = models.ForeignKey(User, null=True, related_name='events') name = models.CharField(null=True, max_length=255, unique=True) - name_sort = models.CharField(null=True, max_length=255, unique=True) + name_sort = models.CharField(null=True, max_length=255, db_index=True) name_find = models.TextField(default='', editable=True) wikipediaId = models.CharField(max_length=1000, blank=True) From c176f6fc7bdf2ca95eaf7274341fe6335260a21c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 10 Oct 2011 15:25:10 +0200 Subject: [PATCH 2/2] update sort name --- pandora/event/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora/event/views.py b/pandora/event/views.py index 49dc7ae4d..e0f28b8df 100644 --- a/pandora/event/views.py +++ b/pandora/event/views.py @@ -76,6 +76,8 @@ def editEvent(request): conflict = True conflict_names.append(name) if not conflict: + if 'name' in data and event.name_sort == unicodedata.normalize('NFKD', event.name): + event.name_sort = unicodedata.normalize('NFKD', data['name']) for key in ('name', 'start', 'startTime', 'end', 'endTime', 'duration', 'durationTime', 'type', 'alternativeNames'): if key in data: