Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
piks3l
Respect My Net
Commits
208df714
Commit
208df714
authored
Feb 22, 2016
by
Okhin
Browse files
Fixing the map on search view #27
parent
4c653836
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
208df714
...
...
@@ -8,3 +8,5 @@ nnmon.egg-info/
# ignore sqlite db
*.db
*.pyc
# Ignore the vim swp files
.*.swp
bt/views.py
View file @
208df714
...
...
@@ -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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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