change 5 hotels on 4 hotels for conference page and expo page

stage8
Alexey 9 years ago
parent 15fba79609
commit c86f7f7eb9
  1. 4
      apps/city/models.py
  2. 2
      apps/place_exposition/models.py
  3. 2
      docker-compose.yml

@ -63,9 +63,9 @@ class City(TranslatableModel):
def get_hotels(self):
"""
returns list of 5 hotels in current city
returns list of 4 hotels in current city
"""
return list(self.hotels.all()[:5])
return list(self.hotels.all()[:4])
def get_events(self):
"""

@ -206,7 +206,7 @@ class PlaceExposition(TranslatableModel, ExpoMixin):
# coordinate current place
place_coord = (float(self.address['lat']), float(self.address['lng']))
# 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
qs = [Q(latitude=item[0]) & Q(longitude=item[1]) for item in hotels_coord]
res = reduce(lambda a,b: a|b, qs)

@ -34,7 +34,7 @@ services:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=expomap
ports:
- "3306:3306"
- "3305:3306"
volumes:
- ./data/mysql/db:/var/lib/mysql

Loading…
Cancel
Save