Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin query fixup #164

Merged
merged 2 commits into from Jul 5, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions zkpylons/controllers/admin.py
Expand Up @@ -150,7 +150,7 @@ def rej_proposals_abstracts(self):
(SELECT review2.miniconf FROM review review2 WHERE review2.proposal_id = proposal.id GROUP BY review2.miniconf ORDER BY count(review2.miniconf) DESC LIMIT 1) AS miniconf,
MAX(review.score) as max,
MIN(review.score) as min,
AVG(review.score) as avg
ROUND(AVG(review.score),2) as avg
FROM proposal
LEFT JOIN review ON (proposal.id=review.proposal_id)
LEFT JOIN proposal_type ON (proposal.proposal_type_id=proposal_type.id)
Expand Down Expand Up @@ -271,7 +271,7 @@ def proposals_by_strong_rank(self):
FROM review as review2
WHERE review2.proposal_id = proposal.id
) AS float(8)
) AS float(8)
) AS numeric(8,2)
) AS "#reviewers at this score / #total reviews %%"
FROM proposal
LEFT JOIN review ON (proposal.id=review.proposal_id)
Expand All @@ -297,7 +297,7 @@ def proposals_by_max_rank(self):
proposal_type.name AS "proposal type",
MAX(review.score) AS max,
MIN(review.score) AS min,
AVG(review.score) AS avg
ROUND(AVG(review.score),2) AS avg
FROM proposal
LEFT JOIN review ON (proposal.id=review.proposal_id)
LEFT JOIN proposal_type ON (proposal.proposal_type_id=proposal_type.id)
Expand All @@ -316,7 +316,7 @@ def proposals_by_stream(self):
stream.name AS stream,
MAX(review.score) AS max,
MIN(review.score) AS min,
AVG(review.score) AS avg
ROUND(AVG(review.score),2) AS avg
FROM proposal
LEFT JOIN review ON (proposal.id=review.proposal_id)
LEFT JOIN proposal_type ON (proposal.proposal_type_id=proposal_type.id)
Expand Down Expand Up @@ -406,7 +406,7 @@ def funding_requests_by_max_rank(self):
funding_type.name AS "funding type",
MAX(funding_review.score) AS max,
MIN(funding_review.score) AS min,
AVG(funding_review.score) AS avg
ROUND(AVG(funding_review.score),2) AS avg
FROM funding
LEFT JOIN funding_review ON (funding.id=funding_review.funding_id)
LEFT JOIN funding_type ON (funding.funding_type_id=funding_type.id)
Expand Down