can anyone help me how to solve overlapping validation in django
moldel.py
start = IntegerRangeField()
end = IntegerRangeField()
form.py
class CheckForm(forms.ModelForm): def clean(self):
start=cleaned_data.get("start")
end = cleaned_data.get("end")
conflicts = Check.objects.filter(
start_bbch__lte=end,
end_end__gte=start,
)
if any(conflicts):
raise forms.ValidationError(_("overlapping not allowed" % conflicts.count()))
return cleaned_data