From 01eee9b024b7717e264ed4b7a00873389fa07cd1 Mon Sep 17 00:00:00 2001 From: adityacp Date: Thu, 5 May 2016 15:21:06 +0530 Subject: model function change --- yaksh/models.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'yaksh') 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 -- cgit