Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
Respect My Net
Commits
591830da
Commit
591830da
authored
Feb 22, 2016
by
Okhin
Browse files
Fixing the map on search view #27
parent
0ac46074
Changes
2
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
591830da
...
...
@@ -8,3 +8,5 @@ nnmon.egg-info/
# ignore sqlite db
*.db
*.pyc
# Ignore the vim swp files
.*.swp
bt/views.py
View file @
591830da
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment