|
|
|
@ -206,7 +206,7 @@ class PlaceExposition(TranslatableModel, ExpoMixin): |
|
|
|
# coordinate current place |
|
|
|
# coordinate current place |
|
|
|
place_coord = (float(self.address['lat']), float(self.address['lng'])) |
|
|
|
place_coord = (float(self.address['lat']), float(self.address['lng'])) |
|
|
|
# 4 coordinates of 4 nearest hotels |
|
|
|
# 4 coordinates of 4 nearest hotels |
|
|
|
hotels_coord = sorted(hotels_coord, key=partial(dist, place_coord))[:5] |
|
|
|
hotels_coord = sorted(hotels_coord, key=partial(dist, place_coord))[:4] |
|
|
|
# start generating filter for queryset |
|
|
|
# start generating filter for queryset |
|
|
|
qs = [Q(latitude=item[0]) & Q(longitude=item[1]) for item in hotels_coord] |
|
|
|
qs = [Q(latitude=item[0]) & Q(longitude=item[1]) for item in hotels_coord] |
|
|
|
res = reduce(lambda a,b: a|b, qs) |
|
|
|
res = reduce(lambda a,b: a|b, qs) |
|
|
|
|