def clean(self): self.Title = clean_text(self.Title) self.GeneralDescription = clean_text(self.GeneralDescription) self.StudentsTaskDescription = clean_text(self.StudentsTaskDescription) min_std = self.NumStudentsMin max_std = self.NumStudentsMax if min_std and max_std: if min_std > max_std: raise ValidationError("Minimum number of students cannot be higher than maximum.") else: raise ValidationError("Min or max number of students cannot be empty")
def clean(self): self.Caption = clean_text(self.Caption) if self.File: if get_ext(self.File.name) not in settings.ALLOWED_PUBLIC_FILES: raise ValidationError( 'This file type is not allowed. Allowed types: ' + print_list(settings.ALLOWED_PUBLIC_FILES))
def clean(self): self.Caption = clean_text(self.Caption) if self.File: if get_ext( self.File.name) not in self.Type.get_allowed_extensions(): raise ValidationError( 'This file type is not allowed. Allowed types: ' + print_list(self.Type.get_allowed_extensions()))
def clean(self): ws = GradeCategory.objects.filter(TimeSlot=get_timeslot_id()) if self.id: ws = ws.exclude(id=self.id) try: w = ws.aggregate(Sum('Weight'))['Weight__sum'] + self.Weight except: w = self.Weight if w > 100: raise ValidationError( "Total weight of categories should be below 100%, it is now {}%!" .format(w)) self.Name = clean_text(self.Name)
def clean(self): self.Feedback = clean_text(self.Feedback)
def clean(self): self.Message = clean_text(self.Message)
def clean(self): self.Comments = clean_text(self.Comments) self.Grade = quantize_number(self.Grade, base=settings.CATEGORY_GRADE_QUANTIZATION ) # rounds grade to step from settings.
def clean(self): self.Description = clean_text(self.Description) self.Name = clean_text(self.Name)
def clean(self): self.Explanation = clean_text(self.Explanation)
def clean(self): # file extensions are cleaned in form. self.Caption = clean_text(self.Caption)
def clean_Subject(self): return clean_text(self.cleaned_data.get('Subject'))
def clean(self): self.Name = clean_text(self.Name) self.ShortName = clean_text(self.ShortName)
def clean(self): self.Caption = clean_text(self.Caption)
def clean(self): self.Name = clean_text(self.Name)
def clean_students(self): return clean_text(self.cleaned_data.get('students'))
def clean(self): # self.Info = clean_text(self.Info) self.FullName = clean_text(self.FullName) self.ShortName = clean_text(self.ShortName)
def clean_Message(self): return clean_text(self.cleaned_data.get('Message'))