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
33b7d8ce
Commit
33b7d8ce
authored
Feb 15, 2016
by
Okhin
Browse files
Fixing the statistics block on indexpage #22
parent
fb010aba
Changes
1
Hide whitespace changes
Inline
Side-by-side
bt/views.py
View file @
33b7d8ce
...
...
@@ -208,7 +208,10 @@ class AddForm(FormView):
operators
=
sorted
([(
i
[
'total'
],
i
[
'operator_ref__name'
])
for
i
in
Violation
.
objects
.
values
(
'operator_ref__name'
).
filter
(
activationid
=
''
).
exclude
(
state__in
=
[
'closed'
,
'ooscope'
,
'duplicate'
]).
annotate
(
total
=
Count
(
'confirmation'
))],
reverse
=
True
)
context
[
'stats'
]
=
[
reports
,
confirms
,
operators
]
context
[
'stats'
]
=
[
(
_
(
'Total confirmed reorts'
),
len
([
i
for
i
,
z
in
reports
if
i
>
0
])),
(
_
(
'Countries with some confirmed reports'
),
len
([
i
for
i
,
z
in
confirms
if
i
>
0
])),
(
_
(
'Operators with some confirmed reports'
),
len
([
i
for
i
,
z
in
oprators
if
i
>
0
]))]
return
context
class
ViolationsList
(
ListView
):
...
...
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