Ejemplo n.º 1
0
    def save(self, commit=True):
        summary = self.cleaned_data.get("summary")
        description = self.cleaned_data.get("description")
        points = self.cleaned_data.get("points")
        test = self.cleaned_data.get("test")
        options = self.cleaned_data.get("options")
        language = self.cleaned_data.get("language")
        type = self.cleaned_data.get("type")
        active = self.cleaned_data.get("active")
        snippet = self.cleaned_data.get("snippet")

        new_question = Question()
        new_question.summary = summary
        new_question.description = description
        new_question.points = points
        new_question.test = test
        new_question.options = options
        new_question.language = language
        new_question.type = type
        new_question.active = active
        new_question.snippet = snippet
        new_question = super(QuestionForm, self).save(commit=False)
        if commit:
            new_question.save()

        return new_question
Ejemplo n.º 2
0
    def save(self):
        summary = self.cleaned_data["summary"]
        description = self.cleaned_data["description"]
        points = self.cleaned_data['points']
        test = self.cleaned_data["test"]
        options = self.cleaned_data['options']
        language = self.cleaned_data['language']
        type = self.cleaned_data["type"]
        active = self.cleaned_data["active"]
        snippet = self.cleaned_data["snippet"]

        new_question = Question()
        new_question.summary = summary
        new_question.description = description
        new_question.points = points
        new_question.test = test
        new_question.options = options
        new_question.language = language
        new_question.type = type
        new_question.active = active
        new_question.snippet = snippet
        new_question.save()