summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/create.sql1
-rw-r--r--db/models.py4
2 files changed, 2 insertions, 3 deletions
diff --git a/db/create.sql b/db/create.sql
index 57c3647..bb7ee35 100644
--- a/db/create.sql
+++ b/db/create.sql
@@ -68,7 +68,6 @@ create table problem (
problem_group_id integer not null,
name varchar(100) not null,
identifier varchar(100) not null,
- is_visible bool not null default true,
constraint problem_pk primary key (id),
constraint problem_fk1 foreign key (language_id) references language (id) on delete no action on update cascade,
constraint problem_fk2 foreign key (problem_group_id) references problem_group (id) on delete no action on update cascade,
diff --git a/db/models.py b/db/models.py
index 4eda2ba..b8d64a1 100644
--- a/db/models.py
+++ b/db/models.py
@@ -27,8 +27,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', 'name', 'identifier'])):
+ __sql_prefix = 'select id, language_id, problem_group_id, name, identifier from problem'
@staticmethod
def get(**kwargs):