fix get_matches
This commit is contained in:
parent
771cec5779
commit
d6b9929052
3 changed files with 4 additions and 5 deletions
|
@ -69,8 +69,8 @@ class Event(models.Model):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_matches(self):
|
def get_matches(self):
|
||||||
layers = filter(lambda l: l['type'] == 'event' or l.get('hasEvents'),
|
layers = [l['id'] for l in filter(lambda l: l['type'] == 'event' or l.get('hasEvents'),
|
||||||
settings.CONFIG['layers'])
|
settings.CONFIG['layers'])]
|
||||||
super_matches = []
|
super_matches = []
|
||||||
q = Q(name_find__contains=" " + self.name)|Q(name_find__contains="|%s"%self.name)
|
q = Q(name_find__contains=" " + self.name)|Q(name_find__contains="|%s"%self.name)
|
||||||
for name in self.alternativeNames:
|
for name in self.alternativeNames:
|
||||||
|
|
|
@ -83,8 +83,8 @@ class Place(models.Model):
|
||||||
return j
|
return j
|
||||||
|
|
||||||
def get_matches(self):
|
def get_matches(self):
|
||||||
layers = filter(lambda l: l['type'] == 'place' or l.get('hasPlaces'),
|
layers = [l['id'] for l in filter(lambda l: l['type'] == 'place' or l.get('hasPlaces'),
|
||||||
settings.CONFIG['layers'])
|
settings.CONFIG['layers'])]
|
||||||
super_matches = []
|
super_matches = []
|
||||||
q = Q(name_find__contains=" " + self.name)|Q(name_find__contains="|%s"%self.name)
|
q = Q(name_find__contains=" " + self.name)|Q(name_find__contains="|%s"%self.name)
|
||||||
for name in self.alternativeNames:
|
for name in self.alternativeNames:
|
||||||
|
|
|
@ -22,7 +22,6 @@ from item.models import Access, Item
|
||||||
from item import utils
|
from item import utils
|
||||||
|
|
||||||
import models
|
import models
|
||||||
import managers
|
|
||||||
|
|
||||||
|
|
||||||
def signin(request):
|
def signin(request):
|
||||||
|
|
Loading…
Reference in a new issue