summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-10-13 15:03:54 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-10-13 15:03:54 +0200
commit4cef12f77d73303226ea5ebc8889f6c2cc4ca958 (patch)
treebc48122c3d4abe9127f1619f977bcfd853473137
parent7eeadda97ad8acbfd5f92bbef61c7f45249eb187 (diff)
Use identifiers instead of names in get_stat
Names have been removed from the database. This code will be updated when we decide what statistics to present to the user.
-rw-r--r--server/user_session.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/user_session.py b/server/user_session.py
index 9d8a675..41c77ac 100644
--- a/server/user_session.py
+++ b/server/user_session.py
@@ -266,9 +266,9 @@ class UserSession(object):
cur.execute("""select * from(
(SELECT
distinct
- l.name as language,
+ l.identifier as language,
pg.id as problem_group_id,
- pg.name as problem_group,
+ pg.identifier as problem_group,
count(distinct p.id) as all,
count(CASE s.done WHEN true THEN true END) as done,
count(CASE s.done WHEN false THEN true END) as in_progress
@@ -276,11 +276,11 @@ class UserSession(object):
INNER JOIN language l ON p.language_id = l.id
INNER JOIN problem_group pg ON p.problem_group_id = pg.id
LEFT JOIN solution s ON s.problem_id = p.id AND s.codeq_user_id = %s
- GROUP BY l.name, pg.id, pg.name)
+ GROUP BY l.identifier, pg.id, pg.identifier)
UNION ALL
(SELECT
distinct
- l.name as language,
+ l.identifier as language,
0 as problem_group_id,
null as problem_group,
count(distinct p.id) as all,
@@ -289,7 +289,7 @@ class UserSession(object):
FROM problem p
INNER JOIN language l ON p.language_id = l.id
LEFT JOIN solution s ON s.problem_id = p.id AND s.codeq_user_id = %s
- GROUP BY l.name)
+ GROUP BY l.identifier)
) as u
ORDER BY u.language, problem_group_id""", (uid, uid,))
#return cur.fetchall()