summaryrefslogtreecommitdiff
path: root/db/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'db/models.py')
-rw-r--r--db/models.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/db/models.py b/db/models.py
index 4eda2ba..17f9681 100644
--- a/db/models.py
+++ b/db/models.py
@@ -7,7 +7,6 @@ from . import get_connection, return_connection
__all__ = ['CodeqUser', 'Solution']
-
class CodeqUser(collections.namedtuple('CodeqUser', ['id', 'username', 'password', 'name', 'email', 'is_admin', 'is_active', 'date_joined', 'last_login'])):
__sql_prefix = 'select id, username, password, name, email, is_admin, is_active, date_joined, last_login from codeq_user'
@@ -27,8 +26,8 @@ class CodeqUser(collections.namedtuple('CodeqUser', ['id', 'username', 'password
def solved_problems(user_id, language):
return _run_sql('select g.identifier, p.identifier from solution s inner join problem p on p.id = s.problem_id inner join problem_group g on g.id = p.problem_group_id inner join language l on l.id = p.language_id where s.codeq_user_id = %s and l.identifier = %s and s.done = True', (user_id, language), fetch_one=False)
-class Problem(collections.namedtuple('Problem', ['id', 'language_id', 'problem_group_id', 'name', 'identifier', 'is_visible'])):
- __sql_prefix = 'select id, language_id, problem_group_id, name, identifier, is_visible from problem'
+class Problem(collections.namedtuple('Problem', ['id', 'language_id', 'problem_group_id', 'identifier'])):
+ __sql_prefix = 'select id, language_id, problem_group_id, identifier from problem'
@staticmethod
def get(**kwargs):