From d6b99290526d2dcb90d61b75b4618ccadc069d65 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 9 Jan 2012 00:08:05 +0530 Subject: [PATCH] fix get_matches --- pandora/event/models.py | 4 ++-- pandora/place/models.py | 4 ++-- pandora/user/views.py | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandora/event/models.py b/pandora/event/models.py index 89f55700..348ff7d7 100644 --- a/pandora/event/models.py +++ b/pandora/event/models.py @@ -69,8 +69,8 @@ class Event(models.Model): return False def get_matches(self): - layers = filter(lambda l: l['type'] == 'event' or l.get('hasEvents'), - settings.CONFIG['layers']) + layers = [l['id'] for l in filter(lambda l: l['type'] == 'event' or l.get('hasEvents'), + settings.CONFIG['layers'])] super_matches = [] q = Q(name_find__contains=" " + self.name)|Q(name_find__contains="|%s"%self.name) for name in self.alternativeNames: diff --git a/pandora/place/models.py b/pandora/place/models.py index 745e5e62..19a329a5 100644 --- a/pandora/place/models.py +++ b/pandora/place/models.py @@ -83,8 +83,8 @@ class Place(models.Model): return j def get_matches(self): - layers = filter(lambda l: l['type'] == 'place' or l.get('hasPlaces'), - settings.CONFIG['layers']) + layers = [l['id'] for l in filter(lambda l: l['type'] == 'place' or l.get('hasPlaces'), + settings.CONFIG['layers'])] super_matches = [] q = Q(name_find__contains=" " + self.name)|Q(name_find__contains="|%s"%self.name) for name in self.alternativeNames: diff --git a/pandora/user/views.py b/pandora/user/views.py index 38f5d662..ec49f12b 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -22,7 +22,6 @@ from item.models import Access, Item from item import utils import models -import managers def signin(request):