Example #1
0
    def clean(self):
        cleaned_data = super(QuestionForm, self).clean()
        unislug = unislugify(cleaned_data.get('subject'))
        if Question.objects.filter(entity=cleaned_data['entity'], unislug=unislug).count():
            raise ValidationError(_("Question already exists."))

        return cleaned_data
Example #2
0
    def clean(self):
        cleaned_data = super(QuestionForm, self).clean()
        unislug = unislugify(cleaned_data.get('subject'))
        if Question.objects.filter(entity=cleaned_data['entity'],
                                   unislug=unislug).count():
            raise ValidationError(_("Question already exists."))

        return cleaned_data
Example #3
0
 def save(self, **kwargs):
     # make a unicode slug from the subject
     self.unislug = unislugify(self.subject)
     return super(Question, self).save(**kwargs)
Example #4
0
 def save(self, **kwargs):
     # make a unicode slug from the subject
     self.unislug = unislugify(self.subject)
     return super(Question, self).save(**kwargs)
Example #5
0
    def clean(self):
        cleaned_data = super(QuestionForm, self).clean()
        unislug = unislugify(cleaned_data.get('subject'))

        return cleaned_data
Example #6
0
    def clean(self):
        cleaned_data = super(QuestionForm, self).clean()
        unislug = unislugify(cleaned_data.get('subject'))

        return cleaned_data