summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2016-05-05 15:21:06 +0530
committeradityacp2016-05-05 15:21:06 +0530
commit01eee9b024b7717e264ed4b7a00873389fa07cd1 (patch)
tree2ba6d306535096e95e466b4fcea57a794ad42dd9
parenta2d3d14e03c7f6a873b4f838752878d2bcab44aa (diff)
downloadonline_test-01eee9b024b7717e264ed4b7a00873389fa07cd1.tar.gz
online_test-01eee9b024b7717e264ed4b7a00873389fa07cd1.tar.bz2
online_test-01eee9b024b7717e264ed4b7a00873389fa07cd1.zip
model function change
-rw-r--r--yaksh/models.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 0ee5a3d..aa08278 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -225,12 +225,8 @@ class Question(models.Model):
def load_from_json(self, questions_list, user):
questions = json.loads(questions_list)
for question in questions:
- Question.objects.get_or_create(summary=question['summary'],
- description=question['description'], points=question['points'],
- test=question['test'], ref_code_path=question['ref_code_path'],
- options=question['options'], language=question['language'],
- type=question['type'], active=question['active'],
- snippet=question['snippet'], user=user)
+ question['user'] = user
+ Question.objects.get_or_create(**question)
def __unicode__(self):
return self.summary