Commit 591830da authored by Okhin's avatar Okhin
Browse files

Fixing the map on search view #27

parent 0ac46074
......@@ -8,3 +8,5 @@ nnmon.egg-info/
# ignore sqlite db
# Ignore the vim swp files
......@@ -270,7 +270,7 @@ class ViolationSearchView(SearchView):
def get_context_data(self, *args, **kwargs):
context = super(ViolationSearchView, self).get_context_data(*args, **kwargs)
countries = sorted([(k, len(list(g)),) for k, g in groupby(sorted([i['country'] for i in self.queryset.values('country')]))])
countryweights=json.dumps([{'iso2': y, 'w': x} for x, y in countries])
countryweights=json.dumps([{'iso2': x, 'w': y} for x, y in countries])
operators = sorted([(k, len(list(g)),) for k, g in groupby(sorted([i['operator_name'] for i in self.queryset.values('operator_name')]))])
context['operators'] = operators
context['countries'] = countries
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment