diff --git a/lostplaces/lostplaces_app/views.py b/lostplaces/lostplaces_app/views.py index 20e4f03..8603934 100644 --- a/lostplaces/lostplaces_app/views.py +++ b/lostplaces/lostplaces_app/views.py @@ -55,6 +55,12 @@ class PlaceListView(IsAuthenticated, ListView): template_name = 'place/place_list.html' ordering = ['name'] + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + print(context) + context['place_map_center'] = Place.average_latlon(self.get_queryset()) + return context + class PlaceDetailView(IsAuthenticated, View): def get(self, request, pk): place = Place.objects.get(pk=pk)