diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-01-05 18:05:47 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-01-05 18:05:47 +0100 |
commit | 547b44c17b058e5605b31fb8b86abf9b2b894608 (patch) | |
tree | f21c7f54f2243b6cc49bcc037689aad0941c2ee9 /db | |
parent | 9acb5e65c128a3d06567f2142a1bf603780187fc (diff) |
monkey.edits: only add solutions to predicates that are actually used when testing
Diffstat (limited to 'db')
-rw-r--r-- | db/models.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/db/models.py b/db/models.py index 2363802..eaf67d7 100644 --- a/db/models.py +++ b/db/models.py @@ -62,6 +62,12 @@ class Problem(collections.namedtuple('Problem', ['id', 'language', 'group', 'ide kwargs = {'p.'+k: v for k, v in kwargs.items()} return _general_filter(kwargs, Problem, Problem.__sql_prefix, order=Problem.__sql_order) + # get a list of problems with the given language identifier + @staticmethod + def filter_language(language): + kwargs = {'l.identifier': language} + return _general_filter(kwargs, Problem, Problem.__sql_prefix, order=Problem.__sql_order) + # 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 from solution' |