Esempio n. 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
Esempio n. 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
Esempio n. 3
0
 def save(self, **kwargs):
     # make a unicode slug from the subject
     self.unislug = unislugify(self.subject)
     return super(Question, self).save(**kwargs)
Esempio n. 4
0
 def save(self, **kwargs):
     # make a unicode slug from the subject
     self.unislug = unislugify(self.subject)
     return super(Question, self).save(**kwargs)
Esempio n. 5
0
    def clean(self):
        cleaned_data = super(QuestionForm, self).clean()
        unislug = unislugify(cleaned_data.get('subject'))

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

        return cleaned_data