events are case insensitive

This commit is contained in:
j 2011-10-30 14:01:03 +01:00
parent e71421f597
commit 0de254984c

View file

@ -72,9 +72,9 @@ class Event(models.Model):
q = q|Q(value__icontains=" " + name)|Q(value__startswith=name) q = q|Q(value__icontains=" " + name)|Q(value__startswith=name)
matches = [] matches = []
for a in Annotation.objects.filter(q): for a in Annotation.objects.filter(q):
words = ox.words(a.value) words = ox.words(a.value.lower())
for name in [self.name] + list(self.alternativeNames): for name in [self.name] + list(self.alternativeNames):
if name in words: if name.lower() in words:
matches.append(a.id) matches.append(a.id)
break break
if not matches: if not matches: