summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/models.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/db/models.py b/db/models.py
index f5c690d..23152c3 100644
--- a/db/models.py
+++ b/db/models.py
@@ -50,20 +50,19 @@ class Problem(collections.namedtuple('Problem', ['id', 'language', 'group', 'ide
# known as Attempt in the original code
class Solution(collections.namedtuple('Solution', ['id', 'done', 'content', 'problem_id', 'codeq_user_id', 'trace'])):
- __sql_prefix = 'select id, done, content, problem_id, codeq_user_id, trace::text from solution'
- __row_conversion = lambda row: (row[0], row[1], row[2], row[3], row[4], json.loads(row[5]))
+ __sql_prefix = 'select id, done, content, problem_id, codeq_user_id, trace from solution'
@staticmethod
def get(**kwargs):
- return _general_get(kwargs, Solution, Solution.__sql_prefix, Solution.__row_conversion)
+ return _general_get(kwargs, Solution, Solution.__sql_prefix)
@staticmethod
def list():
- return _general_list(Solution, Solution.__sql_prefix, Solution.__row_conversion)
+ return _general_list(Solution, Solution.__sql_prefix)
@staticmethod
def filter(**kwargs):
- return _general_filter(kwargs, Solution, Solution.__sql_prefix, Solution.__row_conversion)
+ return _general_filter(kwargs, Solution, Solution.__sql_prefix)
def _no_row_conversion(row):